Gabriel7
asked on
Mysql move - won't work
I added a second hard drive to my VM. The OS is Centos 5.x My msyql database WAS located at /var/lib/mysql and I created a directory called /data/ that points to the new drive. I moved all the files...created the mysql:mysql ownership...changed the my.cnf to show the new path:
[client]
socket = /data/mysql/mysql.sock
[mysqld]
port = 3306
datadir = /data/mysql
BTW...the mysqld DOES start. I can log on using the command line. Just not the webserver.
Restarted server...tested connection to mysql...but I still get this from my web pages...
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2) in xxxxxxxxxxxxxxxxxx
I cannot connect to the database because: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2)
There has to be something still pointing to the /var/lib/mysql folder. Anyone able to help?
[client]
socket = /data/mysql/mysql.sock
[mysqld]
port = 3306
datadir = /data/mysql
BTW...the mysqld DOES start. I can log on using the command line. Just not the webserver.
Restarted server...tested connection to mysql...but I still get this from my web pages...
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock
I cannot connect to the database because: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock
There has to be something still pointing to the /var/lib/mysql folder. Anyone able to help?
ASKER
Shows this...
/var/lib/mysql/mysql.sock
Where I'm trying to move from.
How do I?
/var/lib/mysql/mysql.sock
Where I'm trying to move from.
How do I?
ASKER
Oddly enough, when I start the service it creates a file in the /data/mysql folder called msyql.sock. When I shut down the service, it kills the file. The file size is 0.
srwxrwxrwx 1 mysql mysql
srwxrwxrwx 1 mysql mysql
I looked on my Ubuntu system and I don't see where you can change the location for the PHP MySQL drivers. I'm sure there's a way but I can see what it is.
ASKER
Its not the drivers I'm looking to change. Its the database. I've already moved the databases...moved it to /data/mysql from /var/lib/mysql
Everything seems good...except...I can't get a page to load without that error...and I can't get phpinfo to show the correct path. It still shows /var/lib/mysql.
if I do a ps -ef | grep mysql...the results show /data/mysql
Everything seems good...except...I can't get a page to load without that error...and I can't get phpinfo to show the correct path. It still shows /var/lib/mysql.
if I do a ps -ef | grep mysql...the results show /data/mysql
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Dave...you were so right. The relief you gave me...I can not tell you. Thank you for your help and your patience!!!! My system is working!!!
You're welcome, glad to help.
Open in new window