CentOS 安装官方最新社区版MySQL

发布于 2017-06-24 / MySQL / 0条评论 / 3,277浏览

新弄了虚拟机,想安装最新的MySQL

下载指定版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

第一次安装默认密码查看

$ cat /var/log/mysqld.log

外网访问

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

开机启动

chkconfig mysqld on

这样就算成功了,做个小笔记

评论
站长统计