mysql安装配置

1.mysql安装
2.远程访问配置
3.编码配置

1.安装
linux
sudo apt-get install mysql-server

2.远程访问
1.查看访问权限

select host,user from mysql.user

2.编辑 /etc/mysql/my.cnf
注释掉 bind-address
3.授权可访问用户

grant all privileges on *.* to root@ip identified by '123456' with grant option;

4.重启mysql
service mysql restart

3.编码设置
1.查看数据库编码

show variables like '%character%' '%collation%';

2.编辑 /etc/mysql/my.cnf
[client]
default-character-set=utf8
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
3.重启mysql
service mysql restart

posted @ 2017-03-03 17:11  时光舟  阅读(165)  评论(0编辑  收藏  举报