CentOS 安装官方最新社区版Mysql

yum mysql 5.6

下载指定版yum源 http://dev.mysql.com/downloads/repo/yum/

Cent OS 6.x

wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
yum localinstall mysql-community-release-el6-5.noarch.rpm

Cent OS 7.0

wget https://repo.mysql.com/mysql57-community-release-el7-11.noarch.rpm
yum localinstall mysql57-community-release-el7-11.noarch.rpm
yum install mysql-community-server

编辑/etc/my.cnf [mysql]下加入

# 编码格式
default-character-set=utf8
# 不区分大小写
lower_case_table_names=1
# 重启mysqld服务
service mysqld restart

外网访问

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '12345';
update mysql.user set host = '%' where user = 'root';
flush privileges;

开机启动

chkconfig mysqld on

第一次安装默认密码查看

cat /var/log/mysqld.log