I wanna connect with another server database. for example the code is in abc server and i want database of another server which is xyz server. I have done it. but getting error as
Error: ER_BAD_DB_ERROR: Unknown database 'cp'
where i do have a database as CP
the server code to interact is
var db_config={
"domain" : "http://****/",
"hostname" : "****",
"port" : 3306,
"user" : "*****",
"password" : "****",
"database" : "cp"
}
var connection=mysql.createConnection(db_config);
connection.connect(function(err,s){
if (err){
console.log("Error"+err);
}
else{
console.log("db connected");
}
});
when i remove the database and the credentials are correct i could connect with server. if i use information_schema as db name also the db is getting connected properly. but when i use the other database i am still facing the error as
Error: ER_BAD_DB_ERROR: Unknown database 'cp'
I have made setup for remote access in the particular server and checked in php code, its working fine over there.
Kindly help in this hectic task.