0

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?

  • Can you elaborate the question a little? Which account are you logged into when you access your cmd? Also, please give the output of the command `net user`? – prateekkathal Jan 26 '16 at 08:23
  • hi @kakashihatake2,i already elaborate it. – liubanghaolihai Jan 27 '16 at 11:41
  • 1
    You did not answer my second question, which account are you logged into when you access cmd? Administrator? Guest? or the Chinese/Japanese one? Can you try this command and tell me if it works? `mysql -u root -p admin` – prateekkathal Jan 27 '16 at 16:33

0 Answers0