Connecting to a database which is placed out of wamp?
I am working on codeigniter..almost evrything is done ..but while deploying the app I find that the database to which my app (plus another java app) communicates is on D:/ on server
Till date on my develoer machine the db was placed in "C:\wamp\bin\mysql\mysql5.0.51b\data"
My database.php is as follows
$db_server_ip = 'xxx.xxx.xxx.xxx';
$db['default']['hostname'] = $db_server_ip;
$db['default']['username'] = "root";
$db['default']['password'] = "";
$db['default']['database'] = "mydb";
$db['default']['dbdriver开发者_运维问答'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";
I tried giving
$db['default']['database'] = "D:/mydb";
but it shows
A
Database Error Occurred Unable to select the specified database: D:/mydb
ANy ideas??
Thanks,
MySQL doesn't "run on drives", it runs on systems. Connect to the IP address of the machine running the MySQL server and use the appropriate database name and credentials.
As mentioned by Ignacio, you have to connect to your database-server using the correct IP, Port, Username and password, since your DB is a service. I usually try the connection details in Navicat (or MySQLyog, if you prefer that) first to check if my setup is correct and client and server let me connect. If that does not work, make sure your port 3306 is open and your user is allowed to connect to the database server from your client ip.
精彩评论