我以前在MySQL中访问root用户就好了。但是最近,我不再能够。
我可以正常登录:
mysql -u root -p
这是登录后的mysql状态:
mysql> status
--------------
mysql Ver 14.14 Distrib 5.5.28, for debian-linux-gnu (i686) using readline 6.2
Connection id: 37
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.5.28-0ubuntu0.12.04.3 (Ubuntu)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /var/run/mysqld/mysqld.sock
Uptime: 4 min 16 sec
Threads: 1 Questions: 112 Slow queries: 0 Opens: 191
Flush tables: 1 Open tables: 6 Queries per second avg: 0.437
--------------
但是当我想执行任何操作时,例如:
mysql> CREATE DATABASE moyennegenerale;
ERROR 1044 (42000): Access denied for user 'root'@'%' to database 'moyennegenerale'
我知道%
用来表示任何主机,但我的状态显然是localhost。有人对可能发生的事情有想法吗?