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

Centos下安装Mysql5.7

时间:2017-09-25 18:52:01      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:unicode   mys   policy   com   完成   down   comm   set   get   

升级,建议完成后重启

yum -y update

卸载已安装的Mysql

yum -y remove mysql-libs

安装依赖

yum -y install numactl-libs

下载安装包

wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-common-5.7.19-1.el7.x86_64.rpm
wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-libs-5.7.19-1.el7.x86_64.rpm
wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-libs-compat-5.7.19-1.el7.x86_64.rpm
wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-client-5.7.19-1.el7.x86_64.rpm
wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-community-server-5.7.19-1.el7.x86_64.rpm

安装

rpm -ivh mysql-community-common-5.7.19-1.el7.x86_64.rpm --nosignature
rpm -ivh mysql-community-libs-5.7.19-1.el7.x86_64.rpm --nosignature
rpm -ivh mysql-community-libs-compat-5.7.19-1.el7.x86_64.rpm --nosignature
rpm -ivh mysql-community-client-5.7.19-1.el7.x86_64.rpm --nosignature
rpm -ivh mysql-community-server-5.7.19-1.el7.x86_64.rpm --nosignature

启动

service mysqld start

查看初始密码

grep "password" /var/log/mysqld.log

登录mysql后立即修改密码

SET PASSWORD FOR root@localhost = PASSWORD(newpass);

此处可能提示密码不符合要求,输入下列语句后重新修改密码即可

set global validate_password_policy=0;

设置开机自启

chkconfig mysqld on

修改mysql配置

vim /etc/my.cnf

修改为

[client]
port=3306
default-character-set=utf8mb4
[mysqld]
port=3306
character-set-client-handshake=0
character_set_server=utf8mb4
collation-server=utf8mb4_unicode_ci
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

Centos下安装Mysql5.7

标签:unicode   mys   policy   com   完成   down   comm   set   get   

原文地址:http://www.cnblogs.com/hackyo/p/7593056.html

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