1. 先用localhost登录 # mysql -u root -p Enter password: 2. 执行授权命令 mysql> grant all privileges on *.* to root@'%' identified by '123'; Query OK, 0 rows affected (0.07 sec) 3. 退出再试 mysql> quit Bye 再试登录:
1. 先用root登录 # mysql -u root -p Enter password: 2. 执行授权命令 mysql> grant all privileges on *.* to root@'%' identified by '123'; Query OK, 0 rows affected (0.07 sec) 3. 退出再试 mysql> quit Bye 再试登录: