Thursday, November 1, 2007

MySQL Problems

I had some mysql problems where I could no longer access some databases with a particular user and I could also not login as root anymore. Here are some of the commands that I used to get back to normal:

Kill the process
kill `cat /var/run/mysqld/mysqld.pid`

To start mysql as root (very dangerious way to do this)
/usr/bin/safe_mysqld --skip-grant-tables --user=root &

To Flush the privileges
FLUSH PRIVILEGES;

To change the permissions
grant CREATE,INSERT,DELETE,UPDATE,SELECT on database_name.* to username@localhost;

0 comments: