# 查看所有数据库
show databases;
# 进入指定数据库
use mysql;
# 查看所有数据表
show tables;
# 开放ip访问
# 设置mysql数据库的user表,当user=root时host设为%,表示任何ip都可访问
update user set host="%" where user = "root";
# 退出
exit;
navicat 创建数据库时报错 Access denied for user ‘root‘@‘%to database ‘xxx‘
?
# 登录mysql
> mysql -uroot -p
> password
# 用户授权
> grant all privileges on *.* to 'root'@'%' identified by '数据库密码' with grant option;
# 报错ERROR 1045 (28000): Access denied for user 'root'@'%' (using password: YES)?
# 赋权
> update mysql.user set Insert_priv='Y',Update_priv='Y',Delete_priv='Y',Create_priv='Y',Drop_priv='Y' where user = 'root' and host = '%';
# 刷新权限
> flush privileges;
# 重启mysql...
# 重新登录mysql,执行用户授权
> grant all privileges on *.* to 'root'@'%' identified by '数据库密码' with grant option;