Reset the Root Password of MySQL ServerルートのパスワードをリセットしてMySQLサーバ

By default, MySQL Server will be installed with root superuser without any password.デフォルトでは、 MySQLサーバのスーパーユーザがインストールされることなく、ルートパスワードを入力します。 You can connect to MySQL server as root without requiring password or by keying in blank password.することができます。 rootとしてMySQLサーバに接続してパスワードを必要とすることなく、または空白のままで鍵とパスワードを入力します。 However, if you have set the password for root and forget or unable to recall the password, then you will need to reset the root password for MySQL.しかし、設定している場合はルートのパスワードを忘れたりできませんでした召還するとパスワードを入力する必要があります。 rootのパスワードをリセットするにはMySQLです。

MySQL Reference Manual has detail steps on how to reset password for root which are as below: MySQLリファレンスマニュアルは、詳細手順を実行する方法についてはルートのパスワードをリセットするには以下の通り:

The procedure under Windows:下の手順Windowsの場合:

  1. Log on to the Windows system where MySQL is running as Administrator.ここでは、 Windowsシステムにログオンして管理者としてのMySQLが実行されています。
  2. Stop the MySQL server if it is running. MySQLサーバを停止する場合には実行中です。 For a server that is running as a Windows service, go to the Services manager:を実行しているため、サーバーをWindowsサービスとしてするには、サービスマネージャ:

    Start Menu -> Control Panel -> Administrative Tools -> Servicesスタート" ->コントロールパネル- >管理ツール->サービス

    Then find the MySQL service in the list, and stop it. MySQLのサービスを入力し、検索のリスト、および停止をしてください。

    If your server is not running as a service, you may need to use the Task Manager to force it to stop.使用しているサーバーではないサービスとして実行され、必要に応じて使用して、タスクマネージャを強制的にそれを停止します。

  3. Create a text file and place the following command within it on a single line:テキストファイルを作成するには、以下のコマンドと場所をして、 1つの行:

    SET PASSWORD FOR ‘root’@'localhost’ = PASSWORD(’MyNewPassword’);設定のパスワードを'ルート' @ ' localhost 'の=パスワード( ' mynewpassword ' ) ;

    Save the file with any name.任意の名前でファイルを保存します。 For this example the file will be C:\mysql-init.txt.この例では、ファイルはc : \のMySQL - init.txtです。

  4. Open a console window to get to the DOS command prompt:コンソールウィンドウを開いて、 DOSコマンドプロンプトを取得:

    Start Menu -> Run -> cmd [スタート]メニュー-> "実行- >c m d

  5. If MySQL is installed in C:\mysql. MySQLはインストールした場合ではC : \ MySQLのです。 If MySQL is installed in another location, adjust the following commands accordingly.もしMySQLは別の場所にインストールされ、次のコマンドを調整してください。

    At the DOS command prompt, execute this command:は、 DOSコマンドプロンプトで、このコマンドを実行します:

    C:\> C:\mysql\bin\mysqld-nt –init-file=C:\mysql-init.txt c : \ > c : \ MySQLの\ binに\ mysqldを- NTベースのinit -ファイル= c : \のMySQL - init.txt

    The contents of the file named by the –init-file option are executed at server startup, changing the root password.という名前のファイルの内容をされた- init - fileオプションは、サーバー起動時に実行される、 rootのパスワードを変更してください。 After the server has started successfully, you should delete C:\mysql-init.txt.サーバーが正常に起動した後、削除する必要がc : \のMySQL - init.txtです。

    If you installed MySQL using the MySQL Installation Wizard, you may need to specify a –defaults-file option:を使用してMySQLをインストールした場合、 MySQLのインストールウィザードを指定する必要があります- defaults - fileオプション:

    C:\> “C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt.exe” c : \ > " c : \プログラムファイル\ MySQLの\ MySQLサーバ5.0 \ binに\のmysqld - nt.exe "
    –defaults-file=”C:\Program Files\MySQL\MySQL Server 5.0\my.ini” -デフォルトのファイル= " c : \プログラムファイル\ MySQLの\ MySQLサーバ5.0 \ my.ini "
    –init-file=C:\mysql-init.txt -のinit -ファイル= c : \のMySQL - init.txt

    The appropriate –defaults-file setting can be found using the Services Manager: -デフォルトの設定を、該当するファイルを使用してサービスマネージャがあります:

    Start Menu -> Control Panel -> Administrative Tools -> Servicesスタート" ->コントロールパネル- >管理ツール->サービス

    Find the MySQL service in the list, right-click on it, and choose the Properties option. MySQLのサービスを見つけるのリストは、それを右クリックして、プロパティを選択し、オプションを選択します。 The Path to executable field contains the –defaults-file setting.実行可能ファイルへのパスをフィールドには、 -デフォルト設定ファイルの設定です。 Be sure to supply the –init-file argument with the full system path to the file, regardless of your current working directoryを供給することを確認する-のinit -ファイルの引数にファイルのフルパスをシステムに関係なく、お客様の現在の作業ディレクトリ

  6. Stop the MySQL server, then restart it in normal mode again. MySQLサーバを停止して、通常モードで再起動して入力してください。 If the MySQL server is ran as a service, start it from the Windows Services window. MySQLサーバが実行の場合、サービスとして、 Windowsサービスを開始することを確認してウィンドウを開きます。 If you start the server manually, use whatever command you normally use.手動でサーバを起動した場合、どのコマンドを使用し、通常使用しています。
  7. Connect to MySQL server by using the new password.に接続してMySQLサーバを使用して、新しいパスワードを入力します。

For Unix environment, the procedure for resetting the root password is as follows: for UNIXの環境では、 rootのパスワードをリセットするための手順は以下のとおりです:

  1. Log on to the Unix system as either the Unix root user or as the same user that the mysqld server runs as. UNIXシステムにログオンしてrootユーザとして、 Unixのいずれか、または同じユーザーは、 mysqldサーバを実行]をクリックします。
  2. Locate the .pid file that contains the server’s process ID.を見つけます。 pidファイルは、サーバーのプロセスIDが含まれています。 The exact location and name of this file depend on your distribution, hostname, and configuration.の正確な場所と名前をこのファイルに依存して分布して、ホスト名、および構成します。 Common locations are /var/lib/mysql/, /var/run/mysqld/, and /usr/local/mysql/data/.共通の場所はに/ var / lib / MySQLの/は、 / var /実行/ mysqldを/ 、と/ usr / local / MySQLの/データ/ 。 Generally, the filename has the extension of .pid and begins with either mysqld or the system’s hostname.通常、ファイル名には、拡張子は。 PIDとmysqldが始まるや、システムのホスト名のどちらかです。

    Stop the MySQL server by sending a normal kill (not kill -9) to the mysqld process, using the pathname of the .pid file in the following command: MySQLサーバを停止して殺害され正常に送信する(特定殺す-9 )してmysqldプロセスを使用して、パスした。 pidファイルには、以下のコマンド:

    shell> kill `cat /mysql-data-directory/host_name.pid`シェル>殺す`猫/ mysql-data-directory/host_name.pid `

    Note the use of backticks rather than forward quotes with the cat command; these cause the output of cat to be substituted into the kill command.バックに注意して使用するのではなく、引用符で進むcatコマンド;これらの原因の出力に置換される猫を殺すコマンドを実行します。

  3. Create a text file and place the following command within it on a single line:テキストファイルを作成するには、以下のコマンドと場所をして、 1つの行:

    SET PASSWORD FOR ‘root’@'localhost’ = PASSWORD(’MyNewPassword’);設定のパスワードを'ルート' @ ' localhost 'の=パスワード( ' mynewpassword ' ) ;

    Save the file with any name.任意の名前でファイルを保存します。 For this example the file will be ~/mysql-init.この例では、ファイルは〜 / MySQLの- initプロセスです。

  4. Restart the MySQL server with the special –init-file=~/mysql-init option: MySQLサーバを再起動して、特別のinit -ファイル= 〜 / MySQLの-のinitオプション:

    shell> mysqld_safe –init-file=~/mysql-init &シェル> mysqld_safeで-のinit -ファイル= 〜 / MySQLの-のinit &

    The contents of the init-file are executed at server startup, changing the root password.のinit -ファイルの内容をサーバー起動時に実行されるが、 rootのパスワードを変更してください。 After the server has started successfully you should delete ~/mysql-init.サーバーが正常に起動した後に削除する必要が〜 / MySQLの- initプロセスです。

  5. Connect to MySQL server by using the new password.に接続してMySQLサーバを使用して、新しいパスワードを入力します。

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また、どんなプラットフォームでも、 mysqlクライアントを使用して新しいパスワードを設定して、これの少ない安全な方法のパスワードをリセットして(詳細な命令 hereここで ): ) :

  1. Stop mysqld and restart it with the –skip-grant-tables –user=root options (Windows users omit the –user=root portion). mysqldを停止し、再起動してテーブルのスキップ-助成金-ユーザ=ルートオプション( Windowsユーザユーザ=根の部分を省略して) 。
  2. Connect to the mysqld server with this command: mysqldサーバに接続するには、このコマンド:

    shell> mysql -u rootシェル>のMySQL - uルート

  3. Issue the following statements in the mysql client:問題は、次のステートメントは、 mysqlクライアント:

    mysql> UPDATE mysql.user SET Password=PASSWORD(’newpwd’) MySQLの> "アップデートmysql.userパスワード=パスワードを設定する( ' newpwd ' )
    -> WHERE User=’root’; -ヨ"ユーザー= 'ルート' ;
    mysql> FLUSH PRIVILEGES; MySQLの>フラッシュ権限;

    Replace ‘newpwd’ with the actual root password that you want to use.置き換える' newpwd 'の内の実際のrootのパスワードを使用することを選択します。

  4. You should be able to connect using the new password.を使用して接続することが出来るはずの新しいパスワードを入力します。

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 私のデジタルライフフォーラム .です。



10 Responses to “Reset the Root Password of MySQL Server” 10レスポンスを"ルートのパスワードをリセットしてMySQLサーバ"

  1. Change and Reset MySQL root Password » My Digital Life MySQLのrootのパスワードを変更し、リセット»私のデジタルライフ
    June 6th, 2006 18:12 2006年6月6日18:12
    1

    [...] 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のデータベースの場合には、パスワードを忘れたり、失われたり、詳細は、次の手順を説明し、代替手段は、このガイドの最後の部分、ここで追加のファイルを作成する必要があります: [...]

  2. Mike Scaloraマイクscalora
    October 8th, 2007 03:47 2007年10月8日03:47
    2

    You should add –verbose –console to the command in step 5.追加する必要がコンソールには、コマンドの詳細手順5 。 I got a error because of a copy and paste issue that include a quote of the wrong type but there’s no error feedback without the –console.私は、エラーが発生したため、コピーして貼り付けるには、引用符の問題が間違ったのタイプがありませんフィードバックなしのコンソールでエラーが発生します。 Also, the -console to stop the server with CTRL-C under windows, not sure about linux.また、サーバーを停止するにはコンソールをCtrl - CされてWindowsでは、約Linuxのか分からない。

    -Mike -マイク

  3. Roar轟音
    April 23rd, 2008 23:38 2008年4月23日23:38
    3

    This isn’t correct.これは正しくありません。 The syntax should be “–init” not “-init”.の構文すべきである" -のinit "ない" -のinit "です。

  4. Roar轟音
    April 23rd, 2008 23:39 2008年4月23日23:39
    4

    Ah and now that I’ve posted I see the problem.ああ、今すぐに私は私を参照して問題を掲載します。 This site is disallowing double “-”.このサイトは、禁止ダブル" -"です。 It’s being escaped or something.エスケープしているか何かです。

    Well dear reader, just now that “-init” should have TWO dashes (hyphens), not one.よく親愛なる読者は、ちょうど今は" -のinit "には2つのダッシュ(ハイフン)ではなく、 1つです。

  5. Roar轟音
    April 23rd, 2008 23:39 2008年4月23日23:39
    5

    Gah.がーん。 “know” not “now”. "知って"は"今すぐ確認する"です。 I’m going for coffee now.今すぐコーヒーを飲みに行くんだ。

  6. Robロブ
    April 24th, 2008 10:05 2008年4月24日10:05
    6

    Dude,ヤツ、

    Didn’t see these comments while reading the article, but I figured out the double-hyphen syntax by trial and error.これらのコメントを読み込み中にしなかったの記事を参照だけど考え出したのダブルハイフンの構文を裁判とエラーが発生します。
    Anyway you saved my Life by putting this documentation on the Net !!とにかく私の人生を保存このドキュメントを入れ、ネット上! A thousand thanks ! 1000ありがとう! -Rob -ロブ

  7. Danダン
    April 25th, 2008 01:37 2008年4月25日01:37
    7

    There is a typo on the mysqld startup script.タイプミスでは、 mysqldには、スタートアップスクリプトです。

    The correct command requires TWO dashes before the parameter setting.正しいコマンドダッシュする前に必要な2つのパラメータを設定します。

    The correct command is (note TWO dashes before skip-grant-tables):正しいコマンドは、 (注2つのダッシュをスキップ-助成金-テーブルの前に) :

    mysqld_safe –skip-grant-tables mysqld_safeをスキップ-助成金-テーブル

  8. Kamal BAKOURカマルbakour
    July 31st, 2008 21:18 2008年7月31日21:18
    8

    Procdure to reset root password in MySQL [RedHat & Fedora] MySQLのrootのパスワードをリセットするprocdure [ redhat &ソフト帽]

    ====================================================== ================================================== ====
    Step-1ステップ- 1
    [root@redhat~]#killall mysqld [ルート@ redhat 〜 ] # killallをmysqldの
    [root@redhat~]#/usr/libexec/mysqld –skip-grant-tables –user=root & [ルート@ redhat 〜 ] # / usr / libexec / mysqldをスキップ-助成金-テーブル-ユーザ=ルート&

    ====================================================== ================================================== ====
    Step-2 (In MySQL)ステップ- 2 ( MySQLの)
    [root@redhat~]#mysql [ルート@ redhat 〜 ] # MySQLの
    use mysql; MySQLを使用する;
    update user set password=password(”newpassowrd”) where user=”root”;更新プログラムのユーザのパスワード=パスワードを設定する( " newpassowrd " )ここで、 user =の" root " ;
    flush privileges;フラッシュの権限;
    exit;出口;

    ====================================================== ================================================== ====
    Step-3ステップ- 3
    [root@redhat~]#killall mysqld [ルート@ redhat 〜 ] # killallをmysqldの
    [root@redhat~]#/etc/init.d/mysqld start [ルート@ redhat 〜 ] #て/ etc / init.d / mysqldを開始

    There you goそこに行く : )

  9. Joseホセ
    August 14th, 2008 10:47 2008年8月14日10:47
    9

    phpmyadmin phpMyAdminの

  10. Robロブ
    September 9th, 2008 07:34 2008年9月9日07:34
    10

    Completely wrong syntax, check the code before posting guy完全に間違って構文は、コードを確認して投稿する前にガイ

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= <blockquote cite=""> <cite> <acronymのtitle= <b>ダウンロードの<code> <デル日時= " " >の<em> <i>て<strike> <strong> <q cite="">

Subscribe without commenting登録なしのコメント


Custom Search

New Articles新しい記事

Incoming Search Terms for the Article検索用語を受信するには

reset mysql password MySQLのパスワードをリセット - - mysql forgot password MySQLのパスワードを忘れた場合 - - mysql forgot root password MySQLのrootパスワードを忘れてしまった - - MySQL remove root password MySQLのrootのパスワードを削除 - - remove mysql password MySQLのパスワードを削除する - - mysql default password MySQLのデフォルトのパスワード。 - - mysql reset password MySQLのパスワードをリセット - - mysql reset root password MySQLのrootのパスワードをリセット - - xampp mysql password XAMPPのMySQLのパスワード - - forget mysql password MySQLのパスワードを忘れて - - mysql remove password MySQLのパスワードを削除する - - mysql reset root MySQLのリセットルート - - default mysql password デフォルトのMySQLのパスワード - - reset password mysql MySQLのパスワードをリセット - - ubuntu mysql root password MySQLのrootのパスワードを入力ubuntu - - xampp default password XAMPPのデフォルトのパスワード。 - - remove mysql root password MySQLのrootのパスワードを削除 - - remove password mysql MySQLのパスワードを削除する - - lost mysql password windows 失われたMySQLのパスワードのWindows - - mysql password reset MySQLのパスワードのリセット - - reset xampp password XAMPPのパスワードをリセット - - xampp reset password XAMPPのパスワードをリセット - - recover mysql password MySQLのパスワードを回復する - - resetting mysql password MySQLのパスワードをリセット - - forgot password mysql MySQLのパスワードを忘れた場合 - - mysql lost password windows MySQLのWindowsのパスワードを忘れました - - mysql forget password MySQLのパスワードを忘れて - - mysql root password recovery MySQLのrootパスワードを回復 - - xampp forgot password XAMPPのパスワードを忘れた場合 - - resetting mysql root password MySQLのrootのパスワードをリセット - - mysql password forgot MySQLのパスワードを忘れてしまった - - xampp reset mysql password XAMPPのMySQLのパスワードをリセット - - delete mysql password MySQLのパスワードを削除する - - reset mysql password windows WindowsのMySQLのパスワードをリセット - - Recover MySQL root password Windows WindowsのMySQLのrootのパスワードを回復 - - removing mysql password MySQLのパスワードを削除する - - reset mysql root password windows WindowsのMySQLのrootのパスワードをリセット - - how to remove mysql password MySQLのパスワードを削除する方法 - - reset mysql root MySQLのルートをリセット - - how to reset MySQL password MySQLのパスワードをリセットする方法 - - forgot mysql root password MySQLのrootパスワードを忘れてしまった - - remove root password mysql MySQLのrootのパスワードを削除 - - mysql forgotten password MySQLのパスワードを忘れた場合 - - find mysql password MySQLのパスワードを見つける - - xampp mysql root password XAMPPのMySQLのrootのパスワードを入力 - - mysql password recovery MySQLのパスワードを回復 - - mysql recover root password MySQLのrootのパスワードを回復 - - forget password mysql MySQLのパスワードを忘れて - - mysql password windows MySQLのパスワードのWindows - - xampp mysql default password XAMPPのMySQLのデフォルトのパスワード。 - - reset root password mysql MySQLのrootのパスワードをリセット - - reset root password mysql windows MySQLのWindowsのrootのパスワードをリセット - - mysql reset root password windows MySQLのrootのパスワードをリセットのWindows - - mysql password forget MySQLのパスワードを忘れて - - mysql 5 default password MySQLの5デフォルトのパスワード。 - - forgot password for mysql パスワードを忘れた場合はMySQL - - mysql removing root password MySQLのrootのパスワードを削除する - - recover mysql password windows WindowsのMySQLのパスワードを回復する - - mysql windows lost password MySQLのWindowsのパスワードを忘れました - - windows mysql password WindowsのMySQLのパスワード - - all すべての - - forgot xampp password XAMPPのパスワードを忘れてしまった - - xampp default mysql password XAMPPのデフォルトのMySQLのパスワード - - mysql 5.0 default password MySQL 5.0のデフォルトのパスワード。 - - mySQL recover password windows MySQLのWindowsのパスワードを再設定 - - reset mysql root password MySQLのrootのパスワードをリセット - - recover mysql root password MySQLのrootのパスワードを回復 - - remove password in mysql MySQLのパスワードを削除する - - xampp password mysql XAMPPのMySQLのパスワード - - mysql 5 reset root password MySQLの5 rootのパスワードをリセット - - removing mysql root password MySQLのrootのパスワードを削除する - - xampp password reset XAMPPのパスワードのリセット - - removing root password mysql MySQLのrootのパスワードを削除する - - reset mysql password xampp XAMPPのMySQLのパスワードをリセット - - mysql5 default password mysql5デフォルトのパスワード。 - -