一区二区三区日韩精品-日韩经典一区二区三区-五月激情综合丁香婷婷-欧美精品中文字幕专区

分享

mysql5.7 mysql庫(kù)下面的user表沒(méi)有password字段無(wú)法修改密碼

 小區(qū)木大爺 2019-05-28

如題所述,mysql5.7  mysql庫(kù)下面的user表沒(méi)有password字段無(wú)法修改密碼,

5.7版本已經(jīng)不再使用password來(lái)作為密碼的字段了  而改成了authentication_string

登陸密碼記不起:

[root@master1 ~]# mysql -uroot -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

更改配置

vi /etc/my.cnf
#在mysqld模塊下添加
skip-grant-tables

重啟服務(wù)

systemctl restart mysqld

按照傳統(tǒng)改密碼方式發(fā)現(xiàn)沒(méi)有 password這個(gè)字段。

mysql> update user set password=password('123') where user='root';
ERROR 1054 (42S22): Unknown column 'password' in 'field list'

查詢(xún)user表結(jié)構(gòu)

mysql> desc user;
+------------------------+-----------------------------------+------+-----+-----------------------+-------+
| Field                  | Type                              | Null | Key | Default               | Extra |
+------------------------+-----------------------------------+------+-----+-----------------------+-------+
| Host                   | char(60)                          | NO   | PRI |                       |       |
| User                   | char(32)                          | NO   | PRI |                       |       |
| Select_priv            | enum('N','Y')                     | NO   |     | N                     |       |
| Insert_priv            | enum('N','Y')                     | NO   |     | N                     |       |
| Update_priv            | enum('N','Y')                     | NO   |     | N                     |       |
| Delete_priv            | enum('N','Y')                     | NO   |     | N                     |       |
| Create_priv            | enum('N','Y')                     | NO   |     | N                     |       |
| Drop_priv              | enum('N','Y')                     | NO   |     | N                     |       |
| Reload_priv            | enum('N','Y')                     | NO   |     | N                     |       |
| Shutdown_priv          | enum('N','Y')                     | NO   |     | N                     |       |
| Process_priv           | enum('N','Y')                     | NO   |     | N                     |       |
| File_priv              | enum('N','Y')                     | NO   |     | N                     |       |
| Grant_priv             | enum('N','Y')                     | NO   |     | N                     |       |
| References_priv        | enum('N','Y')                     | NO   |     | N                     |       |
| Index_priv             | enum('N','Y')                     | NO   |     | N                     |       |
| Alter_priv             | enum('N','Y')                     | NO   |     | N                     |       |
| Show_db_priv           | enum('N','Y')                     | NO   |     | N                     |       |
| Super_priv             | enum('N','Y')                     | NO   |     | N                     |       |
| Create_tmp_table_priv  | enum('N','Y')                     | NO   |     | N                     |       |
| Lock_tables_priv       | enum('N','Y')                     | NO   |     | N                     |       |
| Execute_priv           | enum('N','Y')                     | NO   |     | N                     |       |
| Repl_slave_priv        | enum('N','Y')                     | NO   |     | N                     |       |
| Repl_client_priv       | enum('N','Y')                     | NO   |     | N                     |       |
| Create_view_priv       | enum('N','Y')                     | NO   |     | N                     |       |
| Show_view_priv         | enum('N','Y')                     | NO   |     | N                     |       |
| Create_routine_priv    | enum('N','Y')                     | NO   |     | N                     |       |
| Alter_routine_priv     | enum('N','Y')                     | NO   |     | N                     |       |
| Create_user_priv       | enum('N','Y')                     | NO   |     | N                     |       |
| Event_priv             | enum('N','Y')                     | NO   |     | N                     |       |
| Trigger_priv           | enum('N','Y')                     | NO   |     | N                     |       |
| Create_tablespace_priv | enum('N','Y')                     | NO   |     | N                     |       |
| ssl_type               | enum('','ANY','X509','SPECIFIED') | NO   |     |                       |       |
| ssl_cipher             | blob                              | NO   |     | NULL                  |       |
| x509_issuer            | blob                              | NO   |     | NULL                  |       |
| x509_subject           | blob                              | NO   |     | NULL                  |       |
| max_questions          | int(11) unsigned                  | NO   |     | 0                     |       |
| max_updates            | int(11) unsigned                  | NO   |     | 0                     |       |
| max_connections        | int(11) unsigned                  | NO   |     | 0                     |       |
| max_user_connections   | int(11) unsigned                  | NO   |     | 0                     |       |
| plugin                 | char(64)                          | NO   |     | mysql_native_password |       |
| authentication_string  | text                              | YES  |     | NULL                  |       |
| password_expired       | enum('N','Y')                     | NO   |     | N                     |       |
| password_last_changed  | timestamp                         | YES  |     | NULL                  |       |
| password_lifetime      | smallint(5) unsigned              | YES  |     | NULL                  |       |
| account_locked         | enum('N','Y')                     | NO   |     | N                     |       |
+------------------------+-----------------------------------+------+-----+-----------------------+-------+

網(wǎng)上查了一下?lián)f(shuō)5.7 版本password 字段改成authentication_string  password函數(shù)還是原來(lái)的password函數(shù)

mysql> update user set authentication_string=password('123') where user='root';
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 1

 

#更改配置重啟mysql  成功登陸

[root@master1 ~]# vi /etc/my.cnf
注釋 # skip-grant-tables [root@master1 ~]# systemctl restart mysqld [root@master1 ~]# mysql -uroot -p123 mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.21-log Copyright (c) 2000, 2018, 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>

 

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買(mǎi)等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類(lèi)似文章 更多

    日韩精品视频一二三区| 在线播放欧美精品一区| 在线观看国产午夜福利| 丝袜人妻夜夜爽一区二区三区| 中文字幕亚洲在线一区| 精品人妻少妇二区三区| 国产综合香蕉五月婷在线| 国产级别精品一区二区视频| 国产日韩精品欧美综合区| 91天堂免费在线观看| 亚洲一区二区三区日韩91| 五月婷婷综合激情啪啪| 国产一区二区三区色噜噜| 欧美又大又黄刺激视频| 日韩精品免费一区二区三区| 国产日韩欧美在线亚洲| 99福利一区二区视频| 欧美日韩精品综合一区| 日本中文字幕在线精品| 日韩av欧美中文字幕| 亚洲一区在线观看蜜桃| 欧美黑人精品一区二区在线| 日本精品最新字幕视频播放| 日本不卡一本二本三区| 日本办公室三级在线观看| 日本人妻丰满熟妇久久| 亚洲国产性生活高潮免费视频 | 狠狠干狠狠操亚洲综合| 99久久成人精品国产免费| 欧美精品日韩精品一区| 午夜福利国产精品不卡| 国产午夜福利片在线观看| 成年人黄片大全在线观看| 久久热中文字幕在线视频| 少妇一区二区三区精品| 国产精品自拍杆香蕉视频| 偷自拍亚洲欧美一区二页| 国产精品国产亚洲区久久| 久一视频这里只有精品| 精品国模一区二区三区欧美| 亚洲精品国产第一区二区多人|