没人告诉你写作可以赚钱,没有人告诉你创业可以赚钱,没有人告诉你健身可以赚钱,但这些都是已经发生的事情。
——走别人不走的路
https://dev.mysql.com/downloads/file/?id=471503
[root@bigdata111 software]# rpm -qa | grep mariadb
mariadb-5.5.44-2.el7.centos.x86_64
mariadb-server-5.5.44-2.el7.centos.x86_64
mariadb-devel-5.5.44-2.el7.centos.x86_64
mariadb-libs-5.5.44-2.el7.centos.x86_64
[root@bigdata111 software]# rpm -qa | grep mysql
akonadi-mysql-1.9.2-4.el7.x86_64
pcp-pmda-mysql-3.10.6-2.el7.x86_64
qt-mysql-4.8.5-11.el7.x86_64
yun -y romove akonadi-mysql-1.9.2-4.el7.x86_64
yun -y romove pcp-pmda-mysql-3.10.6-2.el7.x86_64
yun -y romove qt-mysql-4.8.5-11.el7.x86_64
yum -y remove mariadb-5.5.44-2.el7.centos.x86_64
yum -y remove mariadb-server-5.5.44-2.el7.centos.x86_64
yum -y remove mariadb-devel-5.5.44-2.el7.centos.x86_64
yum -y remove qt-mysql-4.8.5-11.el7.x86_64
下载完后的检查
新建目录
#mkdir /opt/module/mysql
#tar -xvf mysql-5.7.19-1.el7.x86_64.rpm-bundle.tar -C /opt/software/mysql
#rpm -ivh --nodeps mysql-community-server-5.7.19-1.el7.x86_64.rpm
#rpm -ivh --nodeps mysql-community-client-5.7.19-1.el7.x86_64.rpm
#rpm -ivh mysql-community-common-5.7.19-1.el7.x86_64.rpm
#rpm -ivh mysql-community-libs-5.7.19-1.el7.x86_64.rpm
#rpm -ivh mysql-community-libs-compat-5.7.19-1.el7.x86_64.rpm
查看mysql的服务是否启动 #systemctl status mysqld Active: inactive (dead)
启动mysql的服务 #systemctl start mysqld
再次检查mysql的服务是否启动 #systemctl status mysqld
Active: active (running) since 六 2019-04-27 10:15:26 CST; 32s ago
2019-04-27T02:15:21.399492Z 1 [Note] A temporary password is generated for root@localhost: XKsrpn&sV9cH
登陆到mysql
#mysql -uroot -p'XKsrpn&sV9cH'
0 or LOW |
长度 |
1 or MEDIUM |
长度、大小写、数字、特殊字符 |
2 or STRONG |
长度、大小写、数字、特殊字符、词典 |
注:以下修改是临时修改
mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.05 sec)
b.密码至少要包含的小写字母个数和大写字母个数
mysql> set global validate_password_mixed_case_count=0;
Query OK, 0 rows affected (0.00 sec)
c.密码至少要包含的数字个数
mysql> set global validate_password_number_count=3;
Query OK, 0 rows affected (0.00 sec)
d.密码至少要包含的特殊字符数
mysql> set global validate_password_special_char_count=0;
Query OK, 0 rows affected (0.00 sec)
e.密码最小长度,参数默认为8,
它有最小值的限制,最小值为:validate_password_number_count + 密码至少要包含的数字个数validate_password_special_char_count +特殊字符
(2 * validate_password_mixed_case_count)至少要包含的小写字母个数和大写字母个数
mysql> set global validate_password_length=3;
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+-------+
| Variable_name | Value |
+--------------------------------------+-------+
| validate_password_check_user_name | OFF |
| validate_password_dictionary_file | |
| validate_password_length | 5 |
| validate_password_mixed_case_count | 1 |
| validate_password_number_count | 3 |
| validate_password_policy | LOW |
| validate_password_special_char_count | 0 |
+--------------------------------------+-------+
10.修改密码:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('000000');
11.修改远程登录权限
如上图所示:这个是可以成功远程链接得配置
大家默认的%的位置是localhost,即意味着只能本机访问
查询当前user表内root的登录权限:
Select host,user from user;
修改权限为所有%:
update user set host = '%' where user = 'root';
刷新缓存:
flush privileges;
搞定!