码迷,mamicode.com
首页 > 数据库 > 详细

CentOS7.2通过Yum安装MySQL5.7

时间:2019-02-25 18:50:37      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:art   支持   ati   user   nec   enable   rar   lis   character   

1 下载源

wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm

2安装源

yum localinstall mysql57-community-release-el7-8.noarch.rpm

3检查源是否安装成功

yum repolist enabled | grep "mysql.*-community.*"

  技术图片

4 安装MySQL

yum install mysql-community-server

5 启动MySQL服务

 systemctl start mysqld

6 设置开机启动

 systemctl enable mysqld
 systemctl daemon-reload

7 修改root登陆密码

grep ‘temporary password‘ /var/log/mysqld.log

  技术图片

 

 alter user root@localhost identified by ‘Zj31XXX!‘

8 增加远程用户

 GRANT ALL PRIVILEGES ON *.* TO ‘zhangjin‘@‘%‘ IDENTIFIED BY ‘Zj314159!‘ WITH GRANT OPTION;  

  

  技术图片

 

9 修改mysql编码为UTF8mb4  支持emoji表情

修改/etc/my.cnf添加如下配置

[client]
default-character-set = utf8mb4

[mysql]
default-character-set = utf8mb4


[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
init_connect=‘SET NAMES utf8mb4‘

  重启MySQL

 systemctl restart mysqld

  

技术图片

 

安装完成

  

  

  

  

  

CentOS7.2通过Yum安装MySQL5.7

标签:art   支持   ati   user   nec   enable   rar   lis   character   

原文地址:https://www.cnblogs.com/QuestionsZhang/p/10432245.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!