the mysql root account becomes ''@'localhost'

62 Views Asked by At

I think the root account has lost all privileges,or this root account has been replaced by ''@'localhost'
I use windows 7.
I login in the mysql with root account

C:\Users\Administrator>mysql -u root -p
Enter password: ******

when type use mysql,i got this

mysql> use mysql
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'

then i type show databases;,there are only two

+--------------------+
| Database           |
+--------------------+
| information_schema |
| test               |
+--------------------+
2 rows in set (0.04 sec)

This is the net user

C:\Users\Administrator>net user

\\my-201501121940 的用户帐户

---------------------------------------------------------------------
Administrator            Guest
命令成功完成。

C:\Users\Administrator>mysql -u root -p admin
Enter password: ******
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'admin'

I can't use root account to do anything, so I want to restore root privileges, can someone help me?

0

There are 0 best solutions below