码迷,mamicode.com
首页 > 数据库 > 详细

centos7.6 安装Mysql5.7

时间:2019-09-10 18:11:47      阅读:102      评论:0      收藏:0      [点我收藏+]

标签:serve   sql   glob   用户   unit   ble   安全策略   str   mysql   

#安装Mysql
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
yum localinstall mysql57-community-release-el7-8.noarch.rpm
yum repolist enabled | grep "mysql.*-community.*"
yum install mysql-community-server
systemctl start mysqld
systemctl status mysqld
systemctl enable mysqld
cp /etc/my.cnf /etc/my.cnf_`date +%Y%m%d%H%M%S`
MYSQL_PASS=$(/usr/bin/grep ‘temporary password‘ /var/log/mysqld.log | /usr/bin/grep ‘root@localhost:‘ | /usr/bin/sed ‘s/^.*root@localhost: //g‘)
echo $MYSQL_PASS
mysql -uroot -p$MYSQL_PASS

# mysql修改安全策略
# 查看当前策略
# SHOW VARIABLES LIKE ‘validate_password%‘;
# 修改策略项
# set global validate_password_policy=0;
# set global validate_password_mixed_case_count=0;
# set global validate_password_special_char_count=0;
# set global validate_password_length=6;
# SET PASSWORD FOR ‘root‘@‘localhost‘ = PASSWORD(‘新的密码‘);
# FLUSH PRIVILEGES;
# mysql 设置外网访问
# grant all privileges on *.* to ‘用户名‘@‘%‘ identified by ‘当前密码‘ with grant option;
# FLUSH PRIVILEGES;

centos7.6 安装Mysql5.7

标签:serve   sql   glob   用户   unit   ble   安全策略   str   mysql   

原文地址:https://www.cnblogs.com/jackcui/p/11498458.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!