What to do if MySql.sock file is missing

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

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

2. Check /var/lib/mysql and /tmp for the .sock file (is it in both places?)

3. 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. No 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

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 &

  • 1 Usuários acharam útil
Esta resposta lhe foi útil?

Artigos Relacionados

Manage Database Roles

Solution Database roles are conceptually completely separate from operating system users....

Manage Tablespaces

Tablespaces in PostgreSQL allow database administrators to define locations in the file system...

ColdFusion DSN parameters are not updated

SYMPTOMS New CF DSN records are created.  Even the set of parameters is tried to be updated...

Finding what packages are installed on a Linux system

For distributions that use RPM format packages, use the command: $ rpm -qa You may want to pipe...

What platforms does Linux support?

Linux runs on almost every general-purpose computer made in the last 10 years. It runs on systems...