解决mysql只能localhost登录和只能本机登录的有关问题
解决mysql只能localhost登录和只能本机登录的问题
编辑 /etc/my.cnf ,在:
[mysqld]
内添加一行: skip-name-resolve
MySQL 忽略数据库表名大小写
修改 /etc/my.cnf ,在
[mysqld]
内添加一行: lower_case_table_names=1
grant select,insert,update,delete,alter on *.* to root@"%" Identified by "root";
项目运行过程中:
grant select,update on *.* to root@"%" Identified by "root";
如果希望该用户能够在任何机器上登陆 mysql ,则将 localhost 改为 "%" 。
如果你不想 user1 有密码,可以再打一个命令将密码去掉。
grant select,insert,update,delete on mydb.* to user1@localhost identified by "";