mysql登录和连接 权限

在一些配置中会要求登录mysql

授权的时候注意ip地址是ip地址,localhost是localhost,在grant授权时,如果用localhost,就必须在所登录的配置文件中使用localhost,而不能用相应的ip替代,这样肯定连不上mysql。不然就在grant时候直接用ip就行,当然配置文件也必须写ip。。。

远程登录的时候,注意两点:

第一,先授权  grant all privileges on mustang.* to mustang@9.181.27.26 identified by 'mustang';

第二,看看mysql server 的 防火墙,如果防火墙没关,肯定也登录不进去,myslq会报2003的error。 iptables -F

原文地址:https://www.cnblogs.com/juandx/p/4731022.html