wget https://www.openssl.org/source/openssl-1.1.0f.tar.gz tar -xzvf openssl-1.1.0f.tar.gz cd openssl-1.1.0f ./config --prefix=/usr/local --openssldir=/usr/local/ssl make && make install openssl version -a
grep 'temporary password' /var/log/mysqld.log mysql -uroot -p ALTER USER 'root'@'localhost' IDENTIFIED BY 'root@2017!';
或者
1
set password for 'root'@'localhost'=password('root@2017!');
注意:mysql5.7默认安装了密码安全检查插件(validate_password),默认密码检查策略要求密码必须包含:大小写字母、数字和特殊符号,并且长度不能少于8位。否则会提示ERROR 1819 (HY000): Your password does not satisfy the current policy requirements错误.
忘记root密码解决办法
vim /etc/my.cnf 在[mysqld]的段中加上一句:skip-grant-tables 例如:
mysqldump: [Warning] Using a password on the command line interface can be insecure.
解决办法:
1
vi /etc/mysql/my.cnf
增加mysqldump的用户和密码,则无需在命令行指定
1 2 3
[mysqldump] user=dumper password=dumper@2017!
创建专门的备份用户(可选)
1 2 3 4 5
create user dumper@'127.0.0.1' identified by 'dumper@2017!'; grant select on tempdb.* to dumper@'127.0.0.1'; grant show view on tempdb.* to dumper@'127.0.0.1'; grant lock tables on tempdb.* to dumper@'127.0.0.1'; grant trigger on tempdb.* to dumper@'127.0.0.1';