linux mysql配置
简单方法:
1、下载官方的yum 源
# wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
2、安装yum Repo 针对centos7
# yum -y install mysql57-community-release-el7-10.noarch.rpm
3、安装mysql
# yum -y install mysql-community-server
4、启动mysql,会在/var/log/mysqld.log生成临时密码
systemctl start mysqld.service
5、查看运行状态
# systemctl status mysqld.service
6、查看初始密码
# grep "password" /var/log/mysqld.log
7、进入数据库
mysql -uroot -p # 回车后会提示输入密码
8、初次进入必须修改密码,其他事情做不了(设置密码有规范要求)
mysql>ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
9、更改mysql密码规范,让较简单
mysql>set global validate_password_policy=0;
mysql>set global validate_password_length=1;
10、卸载yum源
# yum -y remove mysql57-community-release-el7-10.noarch
- 点赞
- 收藏
- 关注作者
评论(0)