欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

CentOS7安裝Mysql5.7怎么查看與修改密碼-創(chuàng)新互聯(lián)

本文小編為大家詳細(xì)介紹“CentOS7安裝Mysql5.7怎么查看與修改密碼”,內(nèi)容詳細(xì),步驟清晰,細(xì)節(jié)處理妥當(dāng),希望這篇“CentOS7安裝Mysql5.7怎么查看與修改密碼”文章能幫助大家解決疑惑,下面跟著小編的思路慢慢深入,一起來(lái)學(xué)習(xí)新知識(shí)吧。

創(chuàng)新互聯(lián)建站-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比石河子網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫(kù),直接使用。一站式石河子網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋石河子地區(qū)。費(fèi)用合理售后完善,10年實(shí)體公司更值得信賴。

軟件版本

CentOS release 6.9 (Final)
mysql Client Ver 14.14 Distrib 5.7.18, for Linux (x86_64) using  EditLine wrapper
mysql Server 5.7.18

檢測(cè)是否安裝MySQLServer

檢測(cè)下系統(tǒng)有沒(méi)有自帶的mysql:yum list installed | grep mysql

如果已經(jīng)有的話執(zhí)行命令 yum -y remove mysql-libs.x86_64 卸載已經(jīng)安裝的 MySQL 。

安裝

使用 rpm 包進(jìn)行mysql服務(wù)器的安裝

wget /tupian/20230522/mysql-community-server-5.7.18-1.el6.x86_64.rpm
rpm -ivh mysql-community-server-5.7.18-1.el6.x86_64.rpm

啟動(dòng)

service mysqld start

查看密碼

安裝完成之后會(huì)自動(dòng)在 /var/log/mysqld.log 中生成連接的密碼, 使用 grep "temporary password" /var/log/mysqld.log 命令查看生成的密碼。

初次登錄MySQL客戶端必須重新設(shè)置密碼才能進(jìn)行數(shù)據(jù)的操作,如下:

[root@localhost src]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.7.18
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

密碼設(shè)置

不過(guò)需要注意的是現(xiàn)在MySQL已經(jīng)強(qiáng)制要求強(qiáng)密碼,已經(jīng)不能再用弱密碼比如“123456”了。如果你設(shè)置的密碼過(guò)于簡(jiǎn)單,會(huì)提示錯(cuò)誤:

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

set password 命令

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');

mysqladmin 命令

mysqladmin -u root password "newpass" # 如果root沒(méi)有設(shè)置密碼使用這種方式
mysqladmin -u root password oldpass "newpass" # 如果root設(shè)置了密碼使用這種方式

使用 update 語(yǔ)句

UPDATE user SET authentication_string = PASSWORD('newpass') WHERE user = 'root';

忘記密碼

mysqld_safe --skip-grant-tables&
mysql -u root mysql
mysql> UPDATE user SET authentication_string=PASSWORD("new password") WHERE user='root';
mysql> FLUSH PRIVILEGES;

密碼復(fù)雜度的修改

mysql> show variables like "validate_password%";
+--------------------------------------+--------+
| Variable_name                        | Value  |
+--------------------------------------+--------+
| validate_password_check_user_name    | OFF    |
| validate_password_dictionary_file    |        |
| validate_password_length             | 8      | # 必須8個(gè)字符以上
| validate_password_mixed_case_count   | 1      |
| validate_password_number_count       | 1      |
| validate_password_policy             | MEDIUM | # 具體看下面的配置
| validate_password_special_char_count | 1      |
+--------------------------------------+--------+
7 rows in set (0.01 sec)
mysql> SET GLOBAL  validate_password_policy='LOW';
Query OK, 0 rows affected (0.00 sec)
mysql> SET GLOBAL validate_password_length = 6;
Query OK, 0 rows affected (0.00 sec)
  • LOW政策只測(cè)試密碼長(zhǎng)度。 密碼必須至少有8個(gè)字符長(zhǎng)。

  • MEDIUM政策的條件 密碼必須包含至少1數(shù)字字符,1 大寫和小寫字符,和1特別 (nonalphanumeric)字符。

  • STRONG政策的情況 密碼子字符串長(zhǎng)度為4的或更長(zhǎng)時(shí)間不能匹配 單詞在字典文件中,如果一個(gè)人被指定。

再進(jìn)行密碼的修改試試。

讀到這里,這篇“CentOS7安裝Mysql5.7怎么查看與修改密碼”文章已經(jīng)介紹完畢,想要掌握這篇文章的知識(shí)點(diǎn)還需要大家自己動(dòng)手實(shí)踐使用過(guò)才能領(lǐng)會(huì),如果想了解更多相關(guān)內(nèi)容的文章,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。

網(wǎng)站題目:CentOS7安裝Mysql5.7怎么查看與修改密碼-創(chuàng)新互聯(lián)
本文鏈接:http://chinadenli.net/article34/pehpe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供靜態(tài)網(wǎng)站企業(yè)建站App開發(fā)外貿(mào)建站網(wǎng)頁(yè)設(shè)計(jì)公司品牌網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)