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 !

Neil Lunn
  • 148,042
  • 36
  • 346
  • 317
Vinzgore
  • 97
  • 3
  • 6

1 Answers1

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.

Riedsio
  • 9,758
  • 1
  • 24
  • 33
  • Thanks but this doesn't work ... I still can't connect, even with the new user that should be created ... – Vinzgore Jan 07 '11 at 18:45
  • ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) – Vinzgore Jan 07 '11 at 19:21
  • What was the GRANT statement you executed? – Riedsio Jan 07 '11 at 19:22
  • CREATE USER 'root'@'localhost' IDENTIFIED BY 'passwd'; GRANT ALL ON * . * TO 'root'@'localhost'; – Vinzgore Jan 07 '11 at 19:28
  • 1
    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). – Riedsio Jan 07 '11 at 19:41
  • 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 ! – Vinzgore Jan 07 '11 at 20:27