Saturday 18 March 2017

ER_BAD_DB_ERROR but database is present

I'm creating a project in which I'm using mysqljs in Nodejs. But when I try to connect with database it gives error "ER_BAD_DB_ERROR: Unknown database 'hacker'", but this database exists.

connection = mysql.createConnection({
host     : 'localhost',
user     : 'root',
password : '',
database : 'hacker'
  });
connection.connect();

But when changes the database name to 'test' it connects but when the database name is other then test then it give the above error ER_BAD_DB_ERROR.

Tried to reinstall XAMP but nothing changed.

enter image description here



via Pranav Anand

No comments:

Post a Comment