Alex, > However, for local connections, say connections from a locally hosted > web site via PHP, or a command line connection issued from shell, it
Remote connections are made through TCP/IP. That's why you get the sock error only for local connections. > will return following error message: > Can't connect to local MySQL server through socket > '/var/lib/mysql/mysql.sock' Somewhere over the rainbow - no, but in one of the my.cnf files on your local machine there is still a socket=/var/lib/mysql/mysql.sock entry. Another possible thing is the server is started by a script (mysqld_safe?) with the --socket=/var/lib/mysql/mysql.sock option. There are three my.cnf you should look for: 1) /etc/my.cnf = global options 2) <datadir>/my.cnf = server options, overriding global options 3) <home_directory>/.my.cnf = user specific options, overriding server options To make things a bit more complicated, you cannot only start the server with the socket option, but also the client (mysql). In the my.cnf's mentioned above, also check for [client] and [mysql] and see if socket=/var/lib/mysql/mysql.sock is specified anywhere. HTH, -- Stefan Hinz <[EMAIL PROTECTED]> Geschäftsführer / CEO iConnect GmbH <http://iConnect.de> Heesestr. 6, 12169 Berlin (Germany) Tel: +49 30 7970948-0 Fax: +49 30 7970948-3 ----- Original Message ----- From: "Alex Shi" <[EMAIL PROTECTED]> To: "mysql group" <[EMAIL PROTECTED]> Sent: Sunday, February 02, 2003 12:03 AM Subject: datadir and socket > Hi, > > I have a MySQL 2.23.36 running on a Linux RH 7.1. Its database directory > is /var/lib/mysql/. For some reason I want to change it to /home/mysql/. So > I did following things: > > 1. modify /etc/my.cnf: changed all /var/lib/mysql/ to /home/mysql/ > 2. modyfy /etc/init.d/mysqld: changed /var/lib/mysql/ to /home/mysql/ > 3. copied all database files from /var/lib/mysql/ to /home/mysql/ > 4. restart mysqld > > OK. everything looks fine for connections from foreign machines. > However, for local connections, say connections from a locally hosted > web site via PHP, or a command line connection issued from shell, it > will return following error message: > Can't connect to local MySQL server through socket > '/var/lib/mysql/mysql.sock' > > This was weird, since I had assumed that I made all the neccary changes > in /etc/my.cnf and /etc/init.d/mysqld. > > Seems like mysql has some configure information hard-coded into > its buildup or whatever, and cannot be modified after installation? > > Alex Shi > > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php