Can't connect to mysql because there are no users
Asked Answered
R

1

6

I mistakenly removed all users for mysql ... So I can't connect to mysql.
Does anyone has an idea ?
I tried reinstalling it but it didn't work ...

PS : I am on Archlinux.
Thanks in advance !

Romola answered 7/1, 2011 at 18:14 Comment(0)
T
2

This should help:

http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-unix

In your case, you'd change the init file to GRANT privileges to a new user.

Translation answered 7/1, 2011 at 18:19 Comment(6)
Thanks but this doesn't work ... I still can't connect, even with the new user that should be created ...Romola
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)Romola
What was the GRANT statement you executed?Translation
CREATE USER 'root'@'localhost' IDENTIFIED BY 'passwd'; GRANT ALL ON * . * TO 'root'@'localhost';Romola
I don't see anything obviously wrong... another approach is to do a file level copy the of mysql database (i.e. $datadir/mysql) from another server over and overwrite the one you're having problems with (being sure that the file level permissions are correct).Translation
It worked ! I simply overwrited the user table of mysql database with table from another server, just like you said and it worked ! Thank you !Romola

© 2022 - 2024 — McMap. All rights reserved.