银河麒麟V10部署Mysql8

一、下载合适的mysql8安装包

Mysql官网下载地址:

MySQL :: Download MySQL Community Serverhttps://dev.mysql.com/downloads/mysql/

二、解压安装包mysql-8.1.0-1.el8.x86_64.rpm-bundle.tar:

tar xvf mysql-8.1.0-1.el8.x86_64.rpm-bundle.tar

银河麒麟V10部署Mysql8_第1张图片

 三、依次安装rpm包:  

rpm -ivh mysql-community-common-8.1.0-1.el8.x86_64.rpm
rpm -ivh mysql-community-debuginfo-8.1.0-1.el8.x86_64.rpm
rpm -ivh mysql-community-client-plugins-debuginfo-8.1.0-1.el8.x86_64.rpm
rpm -ivh mysql-community-client-plugins-8.1.0-1.el8.x86_64.rpm
rpm -ivh mysql-community-libs-8.1.0-1.el8.x86_64.rpm
rpm -ivh mysql-community-client-8.1.0-1.el8.x86_64.rpm
rpm  -ivh mysql-community-icu-data-files-8.1.0-1.el8.x86_64.rpm
rpm -ivh mysql-community-server-8.1.0-1.el8.x86_64.rpm

四、启动mysql并从日志中获取默认root密码:

systemctl start mysqld
grep password /var/log/mysqld.log

五、安装后的检查与配置: 

#检查MySQL的安装:

mysql -u root -p    //输入密码 eY7ln,ug!:5I

#登录后必须先改密码,否则其他操作无法进行,需要满足强密码要求的密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'P@ssw0rd!@#';

#查看mysql密码安全策略:
mysql> SHOW VARIABLES LIKE 'validate_password%';

银河麒麟V10部署Mysql8_第2张图片

#关闭mysql密码安全策略:
mysql> SET GLOBAL validate_password.check_user_name = 'OFF';

#创建并授权用户远程登录权限

CREATE USER 'mysqldba'@'%' IDENTIFIED BY 'P@ssw0rd!@#';
GRANT ALL PRIVILEGES ON *.* TO 'mysqldba'@'%'; 
flush privileges;

#查看mysql默认配置文件的顺序,例如:第一个为/etc/my.cnf,我们自定这个文件即可:
mysql --help | grep "Default options" -A 1
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf

#重启MySQL 验证所有配置
service mysql restart 

你可能感兴趣的:(安装部署记录,运维)