yum remove mysql-libs
rpm -qa | grep mariadb
rpm -e --nodeps mariadb-libs-5.5.56-2.el7.x86_64
注:请按照本身的实际需求进行包管理node
yum groupinstall -y "Development tools"
yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel
wget https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm
yum localinstall mysql80-community-release-el7-1.noarch.rpm
yum repolist enabled | grep "mysql.*-community.*"
yum install mysql-community-server
vim /etc/my.cnf default-authentication-plugin=mysql_native_password
grep 'temporary password' /var/log/mysqld.log
mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Welcome_1';
flush privileges;
use mysql; select user,host from user; update user set host = '%' where user = 'root';
3306 MySQL默认端口
22 SSH访问端口mysql
show variables like '%validate%';
注:global配置全局 至关于更改配置文件my.cnfsql
set global validate_password.policy=0; set global validate_password.mixed_case_count=0; set global validate_password.number_count=0; set global validate_password.special_char_count=0; flush privileges;
mysql> alter user 'root'@'%' IDENTIFIED BY '密码';
show variables like '%character%';
[mysqld] init_connect='set collation_connection = utf8_general_ci' init_connect='set collation_database=utf8_general_ci' init_connect='set names utf8' init_connect='set character_set_connection=utf8' character-set-server=utf8 collation-server=utf8_general_ci skip-character-set-client-handshake
systemctl start mysqld
systemctl status mysqld
systemctl enable mysqld.service
systemctl restart mysqld;
mysql5.7默认安装了密码安全检查插件(validate_password)
默认密码检查策略要求密码必须包含:大小写字母、数字和特殊符号,而且长度不能少于8位。shell
flush privileges;
六、配置字符集编码时请使用“utf8_general_ci”而非“utf8_unicode_ci”vim