工作完了以后,回家发现mysql无法登陆了,中午才改完远程连接可以拿navicsat连接呢,晚上回家就连不上了,真是奇了怪。
开启远程的方法
update user set host='%' where user='root';
flush privileges;
- 1
发现原因
解决问题
drop user ''@localhost;
flush privileges;
- 1
- 2
protocol=tcp
- 1
mysql> grant all privileges on *.* to root@'localhost' identified by 'cisco';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
- 1
- 2
- 3