• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • mysql數據庫root口令忘記自動恢復腳本

    發表于:2007-05-26來源:作者:點擊數: 標簽:
    大家好,最近有用戶提出root口令忘記了怎么辦的 需求 ,我也在網上看到過好多這樣的文章,寫的都挺好的,但有些還是有問題,不是少幾句話就是執行時出錯。我寫了一個簡單的小腳本,請大家多指教吧。很簡單但也很適用。 注意事項: 1。該腳本必須將屬主改為ro
     

    大家好,最近有用戶提出root口令忘記了怎么辦的需求,我也在網上看到過好多這樣的文章,寫的都挺好的,但有些還是有問題,不是少幾句話就是執行時出錯。我寫了一個簡單的小腳本,請大家多指教吧。很簡單但也很適用。

    注意事項:
    1。該腳本必須將屬主改為root,權限為700,否則有安全問題。
    2。該腳本的作用是將root用戶的口令清除,若想改口令請用mysqladmin工具來做,或者進入后用update 命令也可
    3。此腳本是針對系統自帶的mysql命令的。如果是自己安裝的源碼包,可以修改關于停止mysql的那一部分。



    #!/bin/sh
    #This is programme is recover the password of root for mysql databases.
    #author is coffee_45
    #data is  4月  4 12:14:03 CST 2005

    #kill mysqld
    /bin/kill `cat /var/run/mysqld/mysqld.pid`  2> /dev/null
    #start mysqld with special paramaters
    /usr/bin/safe_mysqld --skip-grant-tables &
    sleep 3
    #change password for root
    chpw_mysql=/home/command_mysql
    echo "use mysql"  >$chpw_mysql 2> /dev/null
    echo "update user set password=password('') where user='root';" >> $chpw_mysql 2>/dev/null
    echo "quit" >> $chpw_mysql
    mysql < $chpw_mysql
    /etc/init.d/mysqld restart

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>