【mysql疑难杂症】mysql数据库指定ip远程连接数据库
1、修改默认密码
(在开始前看一下mysql库中 user表中的root用户有多少个,如果特别多的话找到自己修改的,在修改时限制自己要修改的用户)
mysql> update user set password=password("mima") where user="root"; #修改密码报错
ERROR 1054 (42S22): Unknown column 'password' in 'field list'
mysql> update mysql.user set authentication_string=password('mima') where user='root'; #修改密码成功
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1
mysql> flush privileges; #立即生效
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
2、授予权限
GRANT ALL PRIVILEGES ON *.* to 'root'@'333.333.333.333' IDENTIFIED BY 'mima' with GRANT OPTION;
3、刷新用户权限
flush privileges;