Change and Reset MySQL root Password改變和重置MySQL的root密碼

Other then the ways specified然後其他的方式指定 here這裡 to reset and change the root password for mySQL database in the case that the password is forgotten or lost, the following instructions explain in details the alternative way at the last part of the guide, where no additional file needs to be created:重置和改變了root密碼為MySQL數據庫,在案件的密碼是忘記或遺失,下列指示解釋,在細節的替代方式,在最後部分的指導,如果沒有額外的文件需要創建:

  1. Login as root to the Windows or Unix-like (Unix, Linux or BSD) machine with the MySQL server.以root身份登錄到Windows或Unix一樣(的Unix , Linux或BSD的)機器與MySQL服務器。
  2. Stop the MySQL server by using either of the following command:停止MySQL服務器使用的下列命令:

    Linux: /etc/rc.d/init.d/mysql stop Linux作業系統:在/ etc / rc.d / init.d /的MySQL的停止
    FreeBSD: /usr/local/etc/rc.d/mysql-server.sh stop FreeBSD作業系統:在/ usr / local的/ etc / rc.d / MySQL的- server.sh停止

  3. Open the mysql server startup script (ie mysql-server.sh - the file executed to start or stop MySQL server.打開MySQL服務器啟動腳本(即MySQL的- server.sh -該文件執行的開始或停止M ySQL服務器。
  4. Add –skip-grant-tables to the end of the line that contains the mysqld_safe command as its parameter.添加-跳過-贈款表到去年底,該行包含mysqld_safe命令作為參數。
  5. Start MySQL server with the following command:啟動MySQL服務器與下面的命令:

    Linux: /etc/rc.d/init.d/mysql start Linux作業系統:在/ etc / rc.d / init.d /的MySQL的開始
    FreeBSD: /usr/local/etc/rc.d/mysql-server.sh start FreeBSD作業系統:在/ usr / local的/ etc / rc.d / MySQL的- server.sh開始

  6. Alternatively, start the MySQL server directly and skip the editing with the following command:或者,啟動MySQL服務器直接跳到編輯與以下命令:

    mysqld_safe –skip-grant-tables & mysqld_safe -跳過-贈款表&

    Depending on your path environment, you may need to point to the correct directory where mysqld_safe is instead.根據您的PATH環境,您可能需要指向正確的目錄下mysqld_safe是不是。

  7. Run the following commands to login as the mysql user and connect to mysql user/permission database:運行下面的命令登錄作為MySQL用戶並連接到MySQL用戶/許可數據庫:

    # mysql -u root mysql # MySQL的中美根的MySQL

  8. Run the update queries to change the MySQL password:運行更新查詢來改變MySQL的密碼:

    mysql> UPDATE user SET Password=PASSWORD(’newrootpassword’) WHERE User=’root’; MySQL的>更新用戶設置密碼=密碼( ' newrootpassword ' )其中user = '根' ;
    mysql> FLUSH PRIVILEGES; MySQL的>沖水特權;

    Note: Replace newrootpassword with the new root password for MySQL server.注:取代newrootpassword與新的root密碼為MySQL服務器。 Flush Privileges is needed to making the password change effect immediately.沖水特權,是需要作出更改密碼立即生效。

  9. Exit mysql database client by typing exit.退出MySQL數據庫的客戶端上鍵入exit 。
  10. Stop MySQL server with commands listed at step 2.停止MySQL服務器與命令列在第2步。
  11. Open the mysql server startup script edit in step 3 again and remove the –skip-grant-tables parameter that has been added.打開MySQL服務器啟動腳本編輯在第3步,再刪除-跳過-贈款表參數已添加。
  12. Start MySQL server by using command from step 5 or 6.啟動MySQL服務器使用命令從步驟5或6 。

For Redhat Linux users, use the following instructions as the root user of Redhat Linux machine:為Redhat的Linux用戶,請使用以下的指示,作為root用戶的版RedHat Linux的機:

  1. Stop MySQL process by using command:停止MySQL的過程中所使用的命令:

    # killall mysqld # killall mysqld

  2. Start the MySQL server with following options:啟動MySQL服務器與下列選項:

    # /usr/libexec/mysqld -Sg –user=root & #是/ usr / libexec / mysqld -雙桂用戶=根&

  3. Start the MySQL client:啟動MySQL客戶端:

    # mysql # MySQL的

    You should see the following message:你應該看到以下訊息:

    Welcome to the MySQL monitor.歡迎您到MySQL的監察。 Commands end with ; or g.命令結束;或g.
    Your MySQL connection id is 1 to server version: 3.xx.xx您的MySQL連接ID是1至服務器版本: 3.xx.xx

    Type ‘help;’ or ‘h’ for help.鍵入'幫助; '或' h '的幫助。 Type ‘c’ to clear the buffer.類型的' C ' ,以清除緩衝區。

    mysql> MySQL的>

  4. Use mysql database:使用MySQL數據庫:

    mysql> USE mysql MySQL的>中使用MySQL

    You should see the following message:你應該看到以下訊息:

    Reading table information for completion of table and column names讀表信息,為完成表和列名
    You can turn off this feature to get a quicker startup with -A您可以關閉此功能,以獲得更快的啟動與- 1

    Database changed數據庫改變

  5. Then, update the password for the root user with the following command:然後,更新密碼,為root用戶與下列命令:

    UPDATE user SET password=password(”newpassword”) WHERE user=”root”;更新用戶設置密碼=密碼( “ newpassword ” )凡用戶= “根” ;

    Replace newpassword with your desired password.取代newpassword與您想要的密碼。 You should see the following message:你應該看到以下訊息:

    Query OK, 2 rows affected (0.03 sec)查詢確定,二行受影響( 0.03秒)
    Rows matched: 2 Changed: 2 Warnings: 0行匹配: 2改變: 2警告: 0

    Rows affected may be different, but the Query OK should be there.行受影響的可能有所不同,但查詢確定,應該有。

  6. Flush the database privileges to reload it in order to make the changes effective:刷新數據庫的特權,重新載入它,以使有效的變化:

    mysql> flush privileges; MySQL的>沖水特權;

    You should get the following result:你應得的結果如下:

    Query OK, 0 rows affected (0.02 sec)查詢確定, 0行受影響( 0.02秒)

  7. Exit the MySQL client by typing exit.退出MySQL客戶端上鍵入exit 。
  8. Kill the MySQL server process by typing killall mysqld.殺死MySQL服務器的過程中輸入killall mysqld 。
  9. Then start MySQL again:然後啟動MySQL的再次:

    /etc/init.d/mysqld start / etc / init.d /的mysqld啟動

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要說明 :這是一個機器翻譯網頁是“按原樣”提供的擔保。 Machine translation may be difficult to understand.機器翻譯可能很難理解。 Please refer to請參閱 original English article英文原版的文章 whenever possible.只要有可能。

Share and contribute or get technical support and help at分享和貢獻,或取得技術的支持和幫助,在 My Digital Life Forums 我的數字生活論壇 .



6 Responses to “Change and Reset MySQL root Password” 6反應“的變化和重置MySQL的root密碼”

  1. Reset the Root Password of MySQL Server » My Digital Life重置root密碼的MySQL服務器»我的數位生活
    June 6th, 2006 18:18 2006年6月6日18時18分
    1

    [...] Alternatively, on any platform, mysql client can be used to set the new password, althought it’s less secure way of resetting the password (detailed instruction here): [...] [ … … ]另外,任何平台上, MySQL客戶端可以用來設置新的密碼,雖然它的安全性較低的方式重設密碼(詳細指示,在這裡) : [ … … ]

  2. Vincitore vincitore
    July 9th, 2006 12:05 2006年7月9日12時05分
    2

    I wanna reset my ZXDSL 831 ADSL Modemn我想重設我的zxdsl 831的ADSL modemn
    Plz tell me the way how to reset it plz告訴我如何重置
    I need to do that right now我需要這樣做的權利,現在

    Best Rgds最佳rgds
    dugger(vincitore) dugger ( vincitore )

  3. Help me retrieve my password - Geeks Talk幫我找回我的密碼-同好談
    December 19th, 2006 14:54 2006年12月19日14時54分
    3

    [...] Re: Help me retrieve my password Try this link… Change and Reset MySQL root Password [ … … ]回复:幫我找回我的密碼嘗試此連結…變化和重置MySQL的root密碼

  4. links for 2007-04-23 | Patrick Kempf鏈接2007年4月23日|帕特里克坎普弗
    April 23rd, 2007 08:23 2007年4月23日8時23分
    4

    [...] Change and Reset MySQL root Password » My Digital Life (tags: mysql administration) No Tags Gelesen: 2 / heute: 2 [...] [ … … ]的變化和重置MySQL的root密碼»我的數位生活(標籤: MySQL的政府)沒有標籤gelesen : 2 / heute : 2 [ … … ]

  5. Mengubah password root pada MySQL 5.0 di Windows. mengubah密碼根pada MySQL 5.0的直接投資的Windows 。 « Iwan Binanto: “hari-hari ku yang berlalu ..” «伊万binanto : “哈-哈古楊berlalu .. ”
    May 5th, 2008 16:52 2008年5月5日16時52分
    5

    [...] judulnya), setelah googling cuma dapat cara untuk mereset dan mengganti password MySQL di UNIX-like di sini. [ … … ] judulnya ) , setelah使用Google cuma應該象限定mereset丹mengganti密碼MySQL的直接投資的UNIX一樣,邸四逆。 Wah, perlu sedikit modifikasi ni … Berikut cara2 yang saya lakukan: 1.議員, perlu sedikit modifikasi倪… berikut cara2楊saya lakukan : 1 。 Kill proses MySQL [...]殺死散文MySQL的[ … … ]

  6. Rajesh Cheethirala rajesh cheethirala
    July 3rd, 2008 05:46 2008年7月3日5時46分
    6

    On ubuntu, command is mysqld_safe –-skip-grant-tables &關於Ubuntu的,指揮是mysqld_safe -跳過-贈款表&

    Extra dash is required so mysql can parse it correctly.短跑是額外的要求,以便MySQL的可以解析正確的。

Leave a Reply離開的答复

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> 您可以使用這些標籤:的<a href="" title=""> <abbr title=""> <acronym title="">的<b> <blockquote cite=""> <cite>的<code> <刪除日期時間= “ ” >的<em>的<i> <q cite=""> <strike>的<strong>

Subscribe without commenting訂閱無評論


Custom Search

New Articles新的條款,

Incoming Search Terms for the Article傳入的搜索條件文章

change mysql root password 改變MySQL的root密碼 - - mysql change root password MySQL的改變root密碼 - - mysql change password MySQL中修改密碼 - - reset mysql password 重置MySQL的密碼 - - reset mysql root password 重置MySQL的root密碼 - - mysql password change MySQL的密碼變更 - - mysql password reset MySQL的密碼重置 - - mysql password recovery MySQL的密碼恢復 - - change root password mysql 改變root密碼的MySQL - - change password mysql 更改密碼的MySQL - - retrieve mysql root password 檢索MySQL的root密碼 - - forgot mysql password 忘了MySQL的密碼 - - mysql root password change MySQL的root密碼變更 - - mysql root password reset MySQL的root密碼重置 - - reset mysql password ubuntu 重置MySQL的密碼Ubuntu的 - - reset mysql root pass 重置MySQL的根通過 - - mysql retrieve root password MySQL的檢索root密碼 - - ubuntu stop mysql Ubuntu的停止MySQL的 - - change password in mysql 變更密碼在MySQL - - mysql reset root pass MySQL的重置根通過 - - How to change Mysql root password 如何改變MySQL的root密碼 - - change mysql password ubuntu 改變MySQL的密碼Ubuntu的 - - CHANGE MYSQL PASSWORD 改變MySQL的密碼 - - how to reset mysql password 如何重置MySQL的密碼 - - mysql reset privileges MySQL的重置特權 - - ubuntu reset mysql root password Ubuntu的重置MySQL的root密碼 - - ubuntu reset mysql password Ubuntu的重置MySQL的密碼 - - how to change password in mysql 如何更改密碼在MySQL - - mysql ubuntu default password MySQL的Ubuntu的默認密碼 - - retrieve mysql password 檢索MySQL的密碼 - - mysql reset password MySQL的重設密碼 - - ubuntu mysql reset password Ubuntu的MySQL的重設密碼 - - reset mysql root password ubuntu 重置MySQL的root密碼Ubuntu的 - - crack mysql password 裂紋MySQL的密碼 - - reset mysql password linux 重置MySQL的密碼的Linux - - forgot mysql root password 忘了MySQL的root密碼 - - reset mysql pass 重置MySQL的通行證 - - all 全部 - - reset password mysql 重設密碼的MySQL - - stop mysql ubuntu 停止MySQL的Ubuntu的 - - ubuntu change mysql password Ubuntu的改變MySQL的密碼 - - ubuntu mysql change password Ubuntu的MySQL的更改密碼 - - mysql set password MySQL的設置密碼 - - mysql lost password MySQL的遺失密碼 - - mysql forgot password MySQL的忘記密碼 - - mysql reset password linux MySQL的重設密碼的Linux - - mysql reset root MySQL的重置根 - - changing mysql root password 改變MySQL的root密碼 - - how to reset mysql root password 如何重置MySQL的root密碼 - - ubuntu mysql default password Ubuntu的MySQL的默認密碼 - - mysql forgot root password MySQL的忘記了root密碼 - - mysql change password root MySQL中修改密碼根 - - ubuntu mysql set root password Ubuntu的設置MySQL的root密碼 - - mysql "change password" MySQL的“更改密碼” - - lost mysql password 失去了MySQL的密碼 - - mysql change root pass MySQL的變更根通過 - - mysql root change password MySQL的根變更密碼 - - ubuntu mysql reset root password Ubuntu的重置MySQL的root密碼 - - resetting mysql password 重置MySQL的密碼 - - mysql reset root password MySQL的root密碼重置 - - change password mysql ubuntu 更改密碼MySQL的Ubuntu的 - - change mysql root pass 改變MySQL的根通過 - - change mysql password linux 改變的MySQL密碼的Linux - - mysql clear password MySQL的明確的密碼 - - mysql password MySQL的密碼 - - mysql lost root password windows MySQL中失去了root密碼的Windows - - mysql reset user MySQL的重置用戶 - - set mysql password 設置MySQL的密碼 - - set password mysql 設置密碼的MySQL - - ubuntu mysql password Ubuntu的MySQL的密碼 - - lost mysql password ubuntu 失去了MySQL的密碼Ubuntu的 - - linux mysql reset password Linux的MySQL的重設密碼 - - reset mysql database password 重置MySQL數據庫的密碼 - - retrieve lost mysql password 找回失去的MySQL密碼 - - linux reset mysql password Linux的重置MySQL的密碼 - -