CentOS7.3下mysql 8.0.13安装配置方法图文教程
一、基础环境
1、操作系统:CentOS 7.3
2、MySQL:8.0.13 链接: https://pan.baidu.com/s/13-j_umr7eEnKFaugw4YTqQ 提取码: 62yt
二、安装MySQL
1、卸载mariadb数据库
rpm -qa | grep mariadb yum -y remove mariadb-libs-5.5.52-1.el7.x86_64
2、安装相关依赖(本文使用CentOS 7.3镜像做本地离线yum源)
yum -y install openssl-devel perl-JSON
3、解压安装MySQL
tar -xvf mysql-8.0.13-1.el7.x86_64.rpm-bundle.tar rpm -ivh mysql-community-*.rpm
4、修改配置文件
vim /etc/my.cnf default-storage-engine = innodb innodb_file_per_table collation-server = utf8_general_ci init-connect = 'SET NAMES utf8' character-set-server = utf8 max_allowed_packet = 100M
5、初始化数据库并启动
mysqld --initialize chown mysql:mysql /var/lib/mysql -R systemctl start mysqld systemctl enable mysqld
6、查看临时密码并通过临时密码修改MySQL密码
cat /var/log/mysqld.log | grep password mysqladmin -uroot -pbga/.tkZw4q! password Test1212!
7、赋远程用户权限
mysql -u root -p create user 'root'@'%' identified with mysql_native_password by 'Test1212!'; grant all privileges on *.* to 'root'@'%' with grant option; flush privileges;
8、修改localhost登录时密码,防止本机登录失败
mysql -uroot -p -h 192.168.0.101 ALTER USER 'root'@'localhost' IDENTIFIED BY 'Test1212!'; flush privileges;
9、修改加密规则
MySql8.0版本和5.0的加密规则不一样,而现在的可视化工具只支持旧的加密方式,如果不修改的话可视化工具可能打不开数据库
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root' PASSWORD EXPIRE NEVER; flush privileges;
精彩专题分享:
mysql不同版本安装教程
mysql5.7各版本安装教程
mysql5.6各版本安装教程
mysql8.0各版本安装教程
相关推荐
aydh 2020-11-12
emmm00 2020-11-17
王艺强 2020-11-17
世樹 2020-11-11
zry 2020-11-11
URML 2020-11-11
spurity 2020-11-10
yifangs 2020-10-13
Andrea0 2020-09-18
Ida 2020-09-16
ltd00 2020-09-12
tufeiax 2020-09-03
xjd0 2020-09-10
greatboylc 2020-09-10
adsadadaddadasda 2020-09-08
疯狂老司机 2020-09-08
CoderToy 2020-11-16
ribavnu 2020-11-16
bianruifeng 2020-11-16