PDA

View Full Version : MySQL upgrade tip



bsalus
02-05-2005, 03:00 AM
Maybe it was just me but when I upgraded to the new MySQL it broke everything. I eventually found the issue. The new MySQL uses new passwords and applications (like Toad for MySQL) or web apps (like my PHP sites) that use the old password style will stop working. This SQL seems to fix the problem:

SET PASSWORD FOR 'user_name'@'your_host' = OLD_PASSWORD('your_password');

HTH :-)
Bryant

blakekr
08-28-2005, 06:52 PM
The problem is, I can't access mysql anymore now that I've upgraded, to try the OLD_PASSWORD fix. Any ideas??

Jonnyb0y
09-04-2005, 01:39 PM
1. Shutdown MySQL (be nice and don't -9 it)
$ kill `pidof mysqld`

2. Start it back up without the grant tables (just cut and paste this replacing your username below).
$ /usr/local/mysql/bin/mysqld --defaults-extra-file=/usr/local/mysql/data/my.cnf --basedir=/usr/local/mysql --datadir=/var/lib/mysql --user=YOURUSERNAME --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock --skip-grant-tables &

3. Log into the MySQL server
$ mysql

4. Select the mysql database
mysql> use mysql;

5. Update the root password:
mysql> UPDATE user SET password = OLD_PASSWORD('yournewpassword') WHERE user = 'root';
(should return '1 row updated'1)

6. Disconnect from the MySQL server:
mysql> ^D (ctrl + D)

7. Restart MySQL
$ /etc/rc.d/init.d/mysqd restart