2008-03-12

alexpgp: (Default)
2008-03-12 01:48 pm

mysql goodness...

I always seem to have the devil's own time getting mysql up and running. Starting with a fresh install, I tried to set a password for the root user and was rebuffed, as if somehow one had already been set.

After several attempts, I finally stumbled across one method of 'resetting' the password that worked.

1. Stop mysqld and restart it with the following command line parameters (for this, I didn't feel compelled to invoke the daemon using mysqld_safe):
       mysqld --skip-grant-tables --user=root &

2. Invoke mysql -u root from the command line.

3. Invoke the following at the mysql> prompt:
       UPDATE mysql.user SET Password=PASSWORD('xxx') WHERE User='root';
       FLUSH PRIVILEGES;
       quit

Me, I reboot afterward.

Cheers...

P.S. Apparently, during installation, mysql-server asks for a root password that I obviously didn't pay attention to when I unthinkingly entered it. Yeow!