mysql> GRANT ALL PRIVILEGES ON . TO ‘root’@‘198.56.211.23’ IDENTIFIED BY ‘password’ WITH GRANT OPTION;
mysql > flush privileges;
198.56.211.23 指定允许访问的ip地址 password 密码
如果允许所有ip可访问 198.56.211.23 替换为 “%”
GRANT ALL PRIVILEGES ON *.* 表示允许访问所有的数据库 database.table 列如 数据库为shop,库中有表 user ,goods ,order,shop.* 访问该数据中所有表 ,指定表 shop.user