linux安装MySql数据库5.7版本
1、下载YUM库。
wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
2、安装YUM库
shell > yum localinstall -y mysql57-community-release-el7-7.noarch.rpm
3、安装数据库
shell > yum install -y mysql-community-server
4、启动MySql服务
shell > systemctl start mysqld.service
5、mysql5.6版本以上会在日志中生成密码,
或者:
yum install mysql-server wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm rpm -ivh mysql57-community-release-el7-8.noarch.rpm
service mysqld start grep "password" /var/log/mysqld.log
日志位置:/var/log/mysqld.log
查看密码:grep 'temporary password' /var/log/mysqld.log
[[email protected] /]# grep 'temporary password' /var/log/mysqld.log
2017-12-06T02:09:06.230000Z 1 [Note] A temporary password is generated for [email protected]: lYKouf=W1Sg
6、登录:
mysql -uroot -plYKouf=W1Sgh
7、修改密码
set global validate_password_policy=0;
ALTER USER USER() IDENTIFIED BY 'root123456';
flush privileges;
grant all privileges on *.* to [email protected]'%' identified by 'root123456';
flush privileges;
8、这里可以对密码进行设置。
set global validate_password_policy=0;
set global validate_password_length=1;指密码长度
validate_password_number_count
validate_password_special_char_count
validate_password_mixed_case_count
global validate_password_length判断密码的标准就基于密码的长度
其中,validate_password_number_count指定了密码中数据的长度,
validate_password_special_char_count指定了密码中特殊字符的长度,
validate_password_mixed_case_count指定了密码中大小字母的长度。
查看密码的设置:
SHOW VARIABLES LIKE 'validate_password%';
下一篇: php google pr 值代码
推荐阅读
-
虚拟机安装mysql数据库(安装mysql详细步骤)
-
linux下apache、mysql、php安装配置详细笔记
-
Linux下编译安装MySQL-Python教程
-
python 连接数据库mysql解压版安装配置及遇到问题
-
linux下Vps自动备份web和mysql数据库的脚本
-
Ubuntu安装MySql5.7
-
CentOS 7.x编译安装Nginx1.10.3+MySQL5.7.16+PHP5.2 5.3 5.4 5.5 5.6 7.0 7.1多版本全能环境
-
windows版本下mysql的安装启动和基础配置图文教程详解
-
mysql 8.0.16 Win10 zip版本安装配置图文教程
-
mysql5.7怎么安装 mysql 5.7安装图文教程