Mysql的登陆:
mysql -u root -p
Mysql修改密码:
格式:mysql> set password for 用户名@localhost = password(‘新密码’);
例子:mysql> set password for root@localhost = password(‘root’);
MySQL连接不上错误:Host is not allowed to connect
用cmd登录Mysql 进行如下操作:
mysql> use mysql;
mysql> update user set host = '%' where user ='root';
mysql> flush privileges;
mysql> select 'host','user' from user where user='root';
mysql> quit