mysql.sock - Knowledge Base Archives - Hivelocity Hosting https://www.hivelocity.net/kb/tag/mysql-sock/ Dedicated Servers, Private Cloud & Colocation Thu, 07 Dec 2023 13:58:45 +0000 en-US hourly 1 https://wordpress.org/?v=6.6 What to Do if MySql.sock File is Missing https://www.hivelocity.net/kb/what-to-do-if-mysql-sock-file-is-missing/ https://www.hivelocity.net/kb/what-to-do-if-mysql-sock-file-is-missing/#respond Sun, 14 Nov 2010 11:24:56 +0000 https://kb.hivelocity.net/?p=2472 If your MySQL connection is failing and returning the message ERROR 2002 (HY000): Can’t connect to local MySQL server through socket, then chances are your MySql.sock file is missing or has been deleted. By following these steps, you’ll be able to diagnose and determine which actions must be taken to get your MySql.sock file back …

What to Do if MySql.sock File is Missing Read More »

The post What to Do if MySql.sock File is Missing appeared first on Hivelocity Hosting.

]]>
If your MySQL connection is failing and returning the message ERROR 2002 (HY000): Can’t connect to local MySQL server through socket, then chances are your MySql.sock file is missing or has been deleted.

By following these steps, you’ll be able to diagnose and determine which actions must be taken to get your MySql.sock file back in working order.

 

Locating a Missing MySql.sock File

To locate a missing mysql.sock file, use the following procedure:

  1. THIS IS THE MOST IMPORTANT STEP! Back up the /var/lib/mysql directory using the following command

    # cp -fr /var/lib/mysql /var/lib/mysql.old

  2. Next, check /var/lib/mysql and /tmp for the .sock file (is it in both places?)
  3. Use this command to recreate the symbolic link to the .sock file:

    # ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

  4. Now check the permissions of the /var/lib/mysql. It should be 0755 and mysql:root. If not:

    # chmod 0755 /var/lib/mysql
    # chown mysql:root /var/lib/mysql

  5. cat /etc/passwd to make sure that the mysql user is there.
  6. Does /var/lib/mysql/mysql/host.MYI exist? If not then:

    # chmod -R 0660 /var/lib/mysql/mysql
    # chown -R mysql:mysql /var/lib/mysql/mysql
    # /usr/bin/mysql_install_db

  7. Now try to force an update:

    # /scripts/mysqlup --force // for cPanel servers only

  8. If all else fails, then you may have a corrupted table. Now before you do this, TRIPLE CHECK that you have backed up the /var/lib/mysql directory. It fact, check it 4 times!

    # rm -fr /var/lib/mysql
    # rm -f /usr/sbin/mysqld

    Then force another update:

    # /scripts/mysqlup --force

  9. Now if all if this did not help, then try:

    # /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/Server_HostName.pid --skip-locking &

 

Popular Links

Looking for more information on MySQL? Search our Knowledge Base!

Interested in more articles about Databases? Navigate to our Categories page using the bar on the left or check out these popular articles:

Popular tags within this category include: MySQL, MSSQL, phpMyAdmin, PostgreSQL, and more.

Don’t see what you’re looking for? Use the search bar at the top to search our entire Knowledge Base.

 

The Hivelocity Difference

Seeking a better Dedicated Server solution? In the market for Private Cloud or Colocation services? Check out Hivelocity’s extensive list of products for great deals and offers.

With best-in-class customer service, affordable pricing, a wide-range of fully-customizable options, and a network like no other, Hivelocity is the hosting solution you’ve been waiting for.

Unsure which of our services is best for your particular needs? Call or live chat with one of our sales agents today and see the difference Hivelocity can make for you.

The post What to Do if MySql.sock File is Missing appeared first on Hivelocity Hosting.

]]>
https://www.hivelocity.net/kb/what-to-do-if-mysql-sock-file-is-missing/feed/ 0