title: Error: ER_PARSE_ERROR: You have an error in your SQL syntax
body: <p>I am using express node.js with mysql to build the api's and want to connect these api's to the front end but i have face an error, due to this my application didn't run properly plzzzz tell me whats the problem in my code.</p>
  
  <p>And my error is :
  Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'USEcoffee_shop' at line 1 </p>
  
  <pre><code>var LocalStrategy = require("passport-local").Strategy;
  var mysql = require('mysql');
  var bcrypt = require('bcrypt-nodejs');
  var dbconfig = require('./database');
  
  var connection = mysql.createConnection(dbconfig.connection);
  
  connection.query('USE' + dbconfig.database);
  
  module.exports = (passport)=&gt;{
      passport.serializeUser((user,done)=&gt;{
          done(null, user.id);
      });
  
      passport.deserializeUser((id,done)=&gt;{
          connection.query("SELECT * FROM users WHERE id = ? ", [id],
              (err,rows)=&gt;{
              done(err,rows[0])
          });
      });
  
  passport.use(
      'local-signup',
      new LocalStrategy({
          api_keyField : 'api_key',
          nameField : 'name',
          phoneField : 'phone',
          emailField : 'email',
          photoField : 'photo',
          passwordField : 'password',
          passReqToCallback:true
      },
      (req,email,password,done)=&gt;{
          connection.query("SELECT * FROM users WHERE email = ?",[email],
              (err,rows)=&gt;{
                  if(err)
                      return done(err);
                  if(rows.lenght){
                      return done(null, false, req.flash('signupMessage','That is Already Taken'));
                  }else{
                      var newUserMysql = {
                          api_key : api_key,
                          name : name,
                          phone : phone,
                          email : email,
                          photo : photo,
                          password : bcrypt.hashSync(password, null, null)
                      };
  
                      var insertQuery = "INSERT INTO users (api_key,name,phone,email,photo,password) VALUES (?,?,?,?,?,?)";
                      connection.query(insertQuery, [newUserMysql.api_key, newUserMysql.name, newUserMysql.phone, newUserMysql.email, newUserMysql.photo, newUserMysql.password],
                          (err,rows)=&gt;{
                              newUserMysql.id = rows.insertId;
  
                              return done(null, newUserMysql);
                          });
  
                  }
  
              });
      })
  
      );
  
  passport.use(
      'local-login',
      new LocalStrategy({
          emailField : 'email',
          passwordField : 'password',
          passReqToCallback:true
      },
      (req,email,password,done)=&gt;{
          connection.query("SELECT * FROM users WHERE email = ?", [email],
              (err,rows)=&gt;{
                  if(err)
                      return done(err);
                  if (!rows.lenght){
                      return done(null, false, req.flash('loginMessage', 'No User Found'));
                  }
                  if (!bcrypt.compareSync(password, rows[0].password))
                      return done(null, false, req.flash('loginMessage','Wrong password'));
  
                      return done(null, rows[0]);
              });
      })
  
      );
  };
  </code></pre>