美文网首页
MySQL配置

MySQL配置

作者: Zyao89 | 来源:发表于2017-02-18 02:12 被阅读15次

作者:Zyao89;转载请保留此行,谢谢;


系统环境

# cat /etc/redhat-release

CentOS Linux release 7.2.1511 (Core)

配置

1、编码
mysql配置文件为/etc/my.cnf

最后加上编码配置

 [mysql]
default-character-set =utf8

这里的字符编码必须和/usr/share/mysql/charsets/Index.xml中一致。

2、远程连接设置

把在所有数据库的所有表的所有权限赋值给位于所有IP地址的root用户。

mysql> grant all privileges on *.* to root@'%'identified by 'password';

如果是新用户而不是root,则要先新建用户

mysql>create user 'username'@'%' identified by 'password';  

此时就可以进行远程连接了。

相关文章

网友评论

      本文标题:MySQL配置

      本文链接:https://www.haomeiwen.com/subject/ymdrwttx.html