最近2018中文字幕在日韩欧美国产成人片_国产日韩精品一区二区在线_在线观看成年美女黄网色视频_国产精品一区三区五区_国产精彩刺激乱对白_看黄色黄大色黄片免费_人人超碰自拍cao_国产高清av在线_亚洲精品电影av_日韩美女尤物视频网站

RELATEED CONSULTING
相關(guān)咨詢(xún)
選擇下列產(chǎn)品馬上在線(xiàn)溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
跳過(guò)授權(quán)表登錄后使用replaceinto創(chuàng)建root權(quán)限用戶(hù)

    起因:

十年的新賓網(wǎng)站建設(shè)經(jīng)驗(yàn),針對(duì)設(shè)計(jì)、前端、開(kāi)發(fā)、售后、文案、推廣等六對(duì)一服務(wù),響應(yīng)快,48小時(shí)及時(shí)工作處理。全網(wǎng)整合營(yíng)銷(xiāo)推廣的優(yōu)勢(shì)是能夠根據(jù)用戶(hù)設(shè)備顯示端的尺寸不同,自動(dòng)調(diào)整新賓建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無(wú)論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計(jì),從而大程度地提升瀏覽體驗(yàn)。創(chuàng)新互聯(lián)從事“新賓網(wǎng)站設(shè)計(jì)”,“新賓網(wǎng)站推廣”以來(lái),每個(gè)客戶(hù)項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。

    剛剛搭建好的MySQL數(shù)據(jù)庫(kù),做基礎(chǔ)優(yōu)化時(shí),不小心把所有用戶(hù)都刪除了,并且退出了。沒(méi)辦法,只好跳過(guò)授權(quán)表登錄,新建root用戶(hù)。

    過(guò)程如下:

一、停掉mysql,跳過(guò)授權(quán)登錄

    [root@explnk-zabbix zabbix-2.2.9]# /etc/init.d/mysqld stop

    Shutting down MySQL... SUCCESS! 

    [root@explnk-zabbix zabbix-2.2.9]# mysqld_safe --skip-grant-table &

    [1] 30178

    [root@explnk-zabbix zabbix-2.2.9]# 160418 10:49:54 mysqld_safe Logging to '/application/mysql/data/explnk-zabbix.err'.

    160418 10:49:54 mysqld_safe Starting mysqld daemon with databases from /application/mysql/data

    

    [root@explnk-zabbix zabbix-2.2.9]# mysql

    Welcome to the MySQL monitor.  Commands end with ; or \g.

    Your MySQL connection id is 1

    Server version: 5.5.32 MySQL Community Server (GPL)

    

    Copyright (c) 2000, 2013, 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>

二、創(chuàng)建擁有root權(quán)限的用戶(hù)

  2.1 錯(cuò)誤例子:

    這里最開(kāi)始遇到個(gè)坑,使用insert into創(chuàng)建的用戶(hù)沒(méi)有任何權(quán)限,登錄之后無(wú)法進(jìn)行操作,語(yǔ)句如下:

    INSERT INTO user (Host,User,Password) VALUES('localhost','root',PASSWORD('biscuit'));

    *************************** 2. row ***************************

                      Host: localhost

                      User: root

                  Password: *7495041D24E489A0096DCFA036B166446FDDD992

               Select_priv: N

               Insert_priv: N

               Update_priv: N

               Delete_priv: N

               Create_priv: N

                 Drop_priv: N

               Reload_priv: N

             Shutdown_priv: N

              Process_priv: N

                 File_priv: N

                Grant_priv: N

           References_priv: N

                Index_priv: N

                Alter_priv: N

              Show_db_priv: N

                Super_priv: N

     Create_tmp_table_priv: N

          Lock_tables_priv: N

              Execute_priv: N

           Repl_slave_priv: N

          Repl_client_priv: N

          Create_view_priv: N

            Show_view_priv: N

       Create_routine_priv: N

        Alter_routine_priv: N

          Create_user_priv: N

                Event_priv: N

              Trigger_priv: N

    Create_tablespace_priv: N

                  ssl_type: 

                ssl_cipher: 

               x509_issuer: 

              x509_subject: 

             max_questions: 0

               max_updates: 0

           max_connections: 0

      max_user_connections: 0

                    plugin: 

     authentication_string: NULL


  2.2 正確方法1:

    mysql> use mysql

    Database changed

    mysql> insert into user (Select_priv,           Insert_priv,           Update_priv,           Delete_priv,           Create_priv,             Drop_priv,           Reload_priv,         Shutdown_priv,          Process_priv,             File_priv,            Grant_priv,       References_priv,            Index_priv,            Alter_priv,          Show_db_priv,            Super_priv, Create_tmp_table_priv,      Lock_tables_priv,          Execute_priv,       Repl_slave_priv,      Repl_client_priv,      Create_view_priv,        Show_view_priv,   Create_routine_priv,    Alter_routine_priv,      Create_user_priv,            Event_priv,          Trigger_priv,Create_tablespace_priv,User,Password) values ( 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','gl','gl');    

    Query OK, 1 row affected, 3 warnings (0.06 sec)

    

    mysql> update user set password=PASSWORD('explink') where user='gl';

    Query OK, 1 row affected (0.08 sec)

    Rows matched: 1  Changed: 1  Warnings: 0

  2.3 正確方法2:

    跳過(guò)授權(quán)表登錄后是無(wú)法使用grant建立用戶(hù)的,報(bào)錯(cuò)如下:

    mysql> grant all privileges on *.* to liang@'localhost' identified by '123456' with grant option;    

    ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

    解決辦法:

    只要刷新一下用戶(hù)權(quán)限即可

    mysql> flush privileges;

    Query OK, 0 rows affected (0.00 sec)

    

    mysql> grant all privileges on *.* to liang@'localhost' identified by '123456' with grant option;

    Query OK, 0 rows affected (0.00 sec)


三、退出登錄并重新啟動(dòng)mysql

    [root@explnk-zabbix zabbix-2.2.9]# /etc/init.d/mysqld stop

    [root@explnk-zabbix zabbix-2.2.9]# /etc/init.d/mysqld start

四、登錄mysql查看權(quán)限

    [root@explnk-zabbix zabbix-2.2.9]# mysql -ugl -p           

    Enter password: 

    Welcome to the MySQL monitor.  Commands end with ; or \g.

    Your MySQL connection id is 1

    Server version: 5.5.32 MySQL Community Server (GPL)

    

    Copyright (c) 2000, 2013, 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> select * from mysql.user\G

    *************************** 3. row ***************************

                      Host: 

                      User: gl

                  Password: *5F70B50879BD3B98CB5A945D3A6A7C92F41B8AE8

               Select_priv: Y

               Insert_priv: Y

               Update_priv: Y

               Delete_priv: Y

               Create_priv: Y

                 Drop_priv: Y

               Reload_priv: Y

             Shutdown_priv: Y

              Process_priv: Y

                 File_priv: Y

                Grant_priv: Y

           References_priv: Y

                Index_priv: Y

                Alter_priv: Y

              Show_db_priv: Y

                Super_priv: Y

     Create_tmp_table_priv: Y

          Lock_tables_priv: Y

              Execute_priv: Y

           Repl_slave_priv: Y

          Repl_client_priv: Y

          Create_view_priv: Y

            Show_view_priv: Y

       Create_routine_priv: Y

        Alter_routine_priv: Y

          Create_user_priv: Y

                Event_priv: Y

              Trigger_priv: Y

    Create_tablespace_priv: Y

                  ssl_type: 

                ssl_cipher: 

               x509_issuer: 

              x509_subject: 

             max_questions: 0

               max_updates: 0

           max_connections: 0

      max_user_connections: 0

                    plugin: 

     authentication_string: NULL

    3 rows in set (0.00 sec)


六、perfect
    

    參考blog:http://my.oschina.net/leejun2005/blog/76140


分享題目:跳過(guò)授權(quán)表登錄后使用replaceinto創(chuàng)建root權(quán)限用戶(hù)
標(biāo)題鏈接:http://fisionsoft.com.cn/article/ggicoi.html