张杰部落格
博客信息

Centos 7.5 YUM安装Mysql

发布时间:『 2018-12-14 20:22』  博客类别:Mysql  阅读(519) 评论(0)

下载Mysql源安装包

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

yum安装mysql源

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

检查mysql源是否安装成功

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

yum安装Mysql

4, yum install mysql-community-server

启动Mysql服务

5, systemctl start mysqld

并添加开机启动

systemctl enable mysqld systemctl daemon-reload

查看Mysql状态

6,systemctl status mysqld

查看默认的mysql密码

此时Mysql安装完成!!!

接下来修改密码

查看默认的mysql密码

 

7, vi /var/log/mysqld.log

修改mysql的密码

登录mysql: mysql -uroot -p 回车

密码: =>g6hj.Nx4e (上面查看的原始密码)

 

8, set password for 'root'@'localhost'=password('Jamie@3975');

9, 添加远程登陆的用户权限

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Jamie@3975' WITH GRANT OPTION;

10,修改mysql字符编码

vi /etc/my.cng

添加

character_set_server=utf8

init_connect='SET NAMES utf8'

11 , 重启Mysql

systemctl stop mysqld

systemctl start mysqld

12 ,查看Mysql字符集

show variables like '%character%'

关键字:   无
评论信息
暂无评论
发表评论
验证码: 
Powered by IMZHANGJIE.CN Copyright © 2015-2021 粤ICP备14056181号