作者: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';
此時就可以進行遠程連接了。