CentOS7_安裝mysql5.7

wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpmmysql

 

rpm -ivh mysql57-community-release-el7-8.noarch.rpmsql

 

yum -y install mysql-server數據庫

 

 

默認配置文件路徑: socket

配置文件:/etc/my.cnf 
日誌文件:/var/log/var/log/mysqld.log 
服務啓動腳本:/usr/lib/systemd/system/mysqld.service 
socket文件:/var/run/mysqld/mysqld.pidide


啓動mysql服務spa

service mysqld restart (systemctl start  mysqld.service)3d

 

查看mysql服務狀態rest

service mysqld status (systemctl status mysqld.service)日誌

 

重置密碼code

grep "password" /var/log/mysqld.log

 

登陸成功之後修改密碼

默認是有對密碼長度的限制的,因此設置的密碼太簡單的話,是通不過的

 

 1 mysql> SHOW VARIABLES LIKE 'validate_password%';
 2 +--------------------------------------+--------+
 3 | Variable_name                        | Value  |
 4 +--------------------------------------+--------+
 5 | validate_password_check_user_name    | OFF    |
 6 | validate_password_dictionary_file    |        |
 7 | validate_password_length             | 8      |
 8 | validate_password_mixed_case_count   | 1      |
 9 | validate_password_number_count       | 1      |
10 | validate_password_policy             | MEDIUM |
11 | validate_password_special_char_count | 1      |
12 +--------------------------------------+--------+
13 7 rows in set (0.01 sec)
14 
15 mysql> set global validate_password_policy=0;
16 Query OK, 0 rows affected (0.00 sec)
17 
18 mysql> set global validate_password_length=1;
19 Query OK, 0 rows affected (0.01 sec)

經過15行和18行的設置,就能夠把密碼設置成諸如root之類的簡單密碼了

 

修改完密碼刷新權限

flush privileges;

 

把在全部數據庫的全部表的全部權限賦值給位於全部IP地址的root用戶

grant all on *.* to 'root'@'%' identified by 'root'  with grant option; 

 

但此時還有一個問題,就是由於安裝了Yum Repository,之後每次yum操做都會自動更新,須要把這個卸載掉:

yum -y remove mysql57-community-release-el7-8.noarch

相關文章
相關標籤/搜索