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