Thursday, September 25, 2008

Starting Mysql on Slackware 12

My first hurdle was getting mysql to start.. I kept getting a nohup error and it wasn’t allowed to connect to the mysql socket. First things first, permissions and users.. make sure the server isn’t running:
ps xa | grep mysql

You should only see your grep process in the list of processes and you’re good to move on.

sudo chown -R mysql:mysql /var/lib/mysql/
sudo chown -R mysql:mysql /var/run/mysql/

Next we need to get our config in place:

sudo mv /etc/my-small.cnf /etc/my.cnf

After that we can run the database installer:

sudo /usr/bin/mysql_install_db

Once that is complete, we can start up the server:

sudo /usr/share/mysql/mysql.server start

We’ll also want to move the mysql script to our rc.d folder so that it can be started upon boot:

sudo cp /usr/share/mysql/mysql.server /etc/rc.d/rc.mysql
sudo chmod 644 /etc/rc.d/rc.mysql

Lastly we’ll create a new password for the root user in mysql:

sudo /usr/bin/mysqladmin -u root password 'your password here'

good luck

No comments: