I can’t get MySQL to work!!! Something about mysql.sock…


So you’ve got problems getting MySQL to start? You’re not alone. There are a couple of things you can do to get things rolling. Linux comes with a database that tells it how to add MySQL users and MySQL tables. However, MySQL is not started by default…and if it is, it requires that default table to be created before it can run without incident. Here are the commands you can issue to get things going:

cd /usr/bin
su mysql
mysql_install_db

Lastly, issue the command:

mysqld_safe &

What you’ve just done is logged into you Linux box as user mysql, then installed the default database…and then with the mysqld_safe & command you initiated the mysql daemon to run in the background. So, things should be good to go now. MySQL is running and you’ll be able to press on with things by adding users and databases.

A bit more info for you…creating databases and users can get tedious via the linux prompt. You can use phpmyadmin or webmin to automate this process and save yourself time and effort.

I can’t get MySQL to work because of some sock error!

This is posted for those of us that use Slackware from time to time.

Take a deep breath…no wait. Take 5 deep ones.
Think happy thoughts.
Try the folowing:

su mysql
mysql_install_db

It could also be that your mysql libs are not ‘owned’ by your mysql user or that your mysql.sock file isn’t linked correctly. To correc this, try the following via shell

su root
ln -s /var/run/mysql/mysql.sock /tmp/mysql.sock
chown mysql /var/lib/mysql/*
chown mysql /var/lib/mysql/mysql/*

Now start mysql like this:

/etc/init.d/mysql start

If you can’t start it, change the file to start automatically during bootup and restart

chmod 755 /etc/rc.d/rc.mysqld
shutdown now
reboot
Creative Commons License
Except where otherwise noted, the content on this site is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.