millhouse Posted September 18, 2005 Posted September 18, 2005 Hi, I really hope that someone can help me here. My site has inexplicably just started showing this message. It has been working perfectly and now this. Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /var/www/html/administration/includes/functions/database.php on line 19 Unable to connect to database server! Can anyone offer an insight into what this means or how to fix it? many thanks ed
Flyer5 Posted September 18, 2005 Posted September 18, 2005 Hi, I really hope that someone can help me here. My site has inexplicably just started showing this message. It has been working perfectly and now this. Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /var/www/html/administration/includes/functions/database.php on line 19 Unable to connect to database server! Can anyone offer an insight into what this means or how to fix it? many thanks ed <{POST_SNAPBACK}> Are you able to open the db using phpmyadmin or whatever your control panel offers?
241 Posted September 18, 2005 Posted September 18, 2005 Warning: mysql_connect(): Can't connect to local MySQL server through socket The error Can't connect to ... normally means that there is no MySQL server running on the system or that you are using an incorrect Unix socket filename or TCP/IP port number when trying to connect to the server. Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /var/www/html/store/catalog/includes/functions/database.php on line 19 Unable to connect to database server! Warning: mysql_connect(): Can't connect to local MySQL server through socket Solution The following are checks for mysql to see if it is running and setup properly. 1. Start by checking whether there is a process named mysqld running on your server host. Use ps xa | grep mysqld on Unix or the Task Manager on Windows. 2. It might also be that the server is running, but you are trying to connect using a TCP/IP port, named pipe, or Unix socket file different from those on which the server is listening. To find out what port is used, and where the socket is, you can do: shell> netstat -l | grep mysql 3. The grant tables must be properly set up so that the server can use them for access control. One way to determine whether you need to initialize the grant tables is to look for a `mysql' directory under the data directory. (The data directory normally is named `data' or `var' and is located under your MySQL installation directory.) Make sure that you have a file named `user.MYD' in the `mysql' database directory. If you do not, execute the mysql_install_db script. After running this script and starting the server, test the initial privileges by executing this command: shell> mysql -u root test 4. Sometimes a simple restart of mysql will fix the problem. No longer giving free advice. Please place deposit in meter slot provided. Individual: [=] SME: [==] Corporation: [===] If deposit does not fit one of the slots provided then you are asking too much! Is your Osc dated try Phoenix raising oscommerce from the ashes.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.