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の場合:
- Log on to the Windows system where MySQL is running as Administrator.ここでは、 Windowsシステムにログオンして管理者としてのMySQLが実行されています。
- 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.使用しているサーバーではないサービスとして実行され、必要に応じて使用して、タスクマネージャを強制的にそれを停止します。
- 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です。
- Open a console window to get to the DOS command prompt:コンソールウィンドウを開いて、 DOSコマンドプロンプトを取得:
Start Menu -> Run -> cmd [スタート]メニュー-> "実行- >c m d
- 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.txtThe 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 -ファイルの引数にファイルのフルパスをシステムに関係なく、お客様の現在の作業ディレクトリ
- 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.手動でサーバを起動した場合、どのコマンドを使用し、通常使用しています。
- 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のパスワードをリセットするための手順は以下のとおりです:
- 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サーバを実行]をクリックします。
- 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コマンド;これらの原因の出力に置換される猫を殺すコマンドを実行します。
- 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プロセスです。
- 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プロセスです。
- 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ここで ): ) :
- Stop mysqld and restart it with the –skip-grant-tables –user=root options (Windows users omit the –user=root portion). mysqldを停止し、再起動してテーブルのスキップ-助成金-ユーザ=ルートオプション( Windowsユーザユーザ=根の部分を省略して) 。
- Connect to the mysqld server with this command: mysqldサーバに接続するには、このコマンド:
shell> mysql -u rootシェル>のMySQL - uルート
- 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のパスワードを使用することを選択します。
- 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 私のデジタルライフフォーラム .です。
Related Articles関連記事
- Change and Reset MySQL root Password MySQLのrootのパスワードを変更し、リセット
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 3 FreeBSDの6.0をインストールするWebサーバーのApache 2.2 、 MySQL 5.0以降およびPHP 5 -パート3
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4ウェブサーバーでは、 Windows XPをインストールするのApache2 、 PHP5とmysql4 -パート4
- Check and Optimize MySQL Database Automatically with Crontab/Cron MySQLデータベースの最適化を自動的にチェックのcrontab / cronの
- Using phpMyAdmin for Effective MySQL Management in Windows XP MySQLの管理を効果的に使用してphpMyAdminのでは、 Windows XP
- Fix for Munin MySQL Monitoring Plugin Graph Not Showing or Blank munin MySQLの監視差込式の修正プログラムまたは空白のグラフに表示されていません
- How to Reset WordPress Password to Recover Forgotten Secret WordPressのパスワードをリセットする方法忘れてしまったの秘密を回復する
- How to Reset AdSense Password Not Associated with Google Account AdSenseのパスワードをリセットする方法Googleアカウントに関連付けられていません
- Disable Direct Root Login and User Access via SSH to Server rootのログインとユーザーのアクセスを無効に直接サーバーにssh経由で
- Install phpBB 2 in Windows XP running on Apache 2, PHP 5 and MySQL 4 phpBBの2のインストールでは、 Windows XPで実行されるApacheの2 、 PHP 5へとMySQL 4

































June 6th, 2006 18:12 2006年6月6日18:12
[...] 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のデータベースの場合には、パスワードを忘れたり、失われたり、詳細は、次の手順を説明し、代替手段は、このガイドの最後の部分、ここで追加のファイルを作成する必要があります: [...]
October 8th, 2007 03:47 2007年10月8日03:47
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 -マイク
April 23rd, 2008 23:38 2008年4月23日23:38
This isn’t correct.これは正しくありません。 The syntax should be “–init” not “-init”.の構文すべきである" -のinit "ない" -のinit "です。
April 23rd, 2008 23:39 2008年4月23日23:39
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つです。
April 23rd, 2008 23:39 2008年4月23日23:39
Gah.がーん。 “know” not “now”. "知って"は"今すぐ確認する"です。 I’m going for coffee now.今すぐコーヒーを飲みに行くんだ。
April 24th, 2008 10:05 2008年4月24日10:05
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 -ロブ
April 25th, 2008 01:37 2008年4月25日01:37
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をスキップ-助成金-テーブル
July 31st, 2008 21:18 2008年7月31日21:18
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そこに行く
August 14th, 2008 10:47 2008年8月14日10:47
phpmyadmin phpMyAdminの
September 9th, 2008 07:34 2008年9月9日07:34
Completely wrong syntax, check the code before posting guy完全に間違って構文は、コードを確認して投稿する前にガイ