MySQL upgrade and password lost

Alles, was MariaDB und MySQL betrifft, kann hier besprochen werden.

MySQL upgrade and password lost

Postby vincentc » 30. October 2008 11:23

After upgrading XAMMP from 0.7.3 to 0.7.4 on MAC with the upgrade patch, i was unable to connect to mysql with root login. After 3 hours searching the net and try different options, here you'll find the solution to reset the root password :

1. stop all services and instances of MySQL

2. Run
Code: Select all
sh mysql.server start --skip-grant-tables


3. Now you can access phpmyadmin. Go to 'mysql' schema and try to access the user table. For me, it was broken, so i have needed to repair it. When i look at the repair table, i found bad users that i don't recognize (dev...)

option a
If you are under MAC and use Time machine, you can simply restore files : user.frm, user.MYD and user.MYI. It worked for me.

option b
If root doesn't exist, you can create it. Or in SQL prompt just issue the following command :
Code: Select all
UPDATE user SET password=PASSWORD("abcd") WHERE user="root";
FLUSH PRIVILEGES;


4. restart mysql and it will be ok to access with root login.

Hope you'll find this usefull.[/list]
vincentc
 
Posts: 7
Joined: 30. October 2008 11:03

Return to MariaDB - MySQL

Who is online

Users browsing this forum: No registered users and 73 guests