http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
php
rpm -uvh(-ivh) mysql57-community-release-el7-9.noarch.rpm
mysql
sudo yum install mysql-community-server
sql
sudo service mysqld start
shell
sudo service mysqld status
函數
sudo grep 'temporary password' /var/log/mysqld.log
日誌
mysql -u root -p
code
若是發現語句沒法執行,應該是語句中的空格問題,手打代替粘貼複製。orm
#密碼強度可由validate password strength()函數評估(返回0至100之間的數),如: mysql>select VALIDATE_PASSWORD_STRENGTH('123456'); mysql>select VALIDATE_PASSWORD_STRENGTH('Password@123456'); #修改方法以下: set global validate_password_policy=low; set global validate_password_length=4; ALTER USER USER() IDENTIFIED BY '123456';
mysql> SHOW VARIABLES LIKE 'validate_password%'; +--------------------------------------+-------+ | Variable_name | Value | +--------------------------------------+-------+ | validate_password_check_user_name | OFF | | validate_password_dictionary_file | | | validate_password_length | 8 | | validate_password_mixed_case_count | 1 | | validate_password_number_count | 1 | | validate_password_policy | LOW | | validate_password_special_char_count | 1 | +--------------------------------------+-------+ 7 rows in set (0.00 sec) mysql>
mysql> select @@log_error; +---------------------+ | @@log_error | +---------------------+ | /var/log/mysqld.log | +---------------------+ 1 row in set (0.00 sec) mysql> # grep "password" /var/log/mysqld.log 命令獲取MySQL的臨時密碼
一、sudo rpm -Uvh platform-and-version-specific-package-name.rpm 二、sudo rpm -Uvh mysql57-community-release-el6-n.noarch.rpm 三、yum repolist all | grep mysql 四、sudo yum install mysql-community-server 五、sudo service mysqld start 六、sudo service mysqld status 七、sudo grep 'temporary password' /var/log/mysqld.log 八、mysql -uroot -p 九、ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
MySQL入門server