Help us understand the problem. What is going on with this article?

Mysqlのrootユーザのpasswordを初期化(変更)する

More than 5 years have passed since last update.

Mysqlのrootユーザのpasswordを変更する

  1. mysqld_safeの場所を探し、skip-grant-tablesで起動します。普通のmysqldプロセスはstopかkillしておいてください。
$ mysql.server stop
$ /usr/local/bin/mysqld_safe --skip-grant-tables

140915 11:19:49 mysqld_safe Logging to '/usr/local/var/mysql/SPICE.local.err'.
140915 11:19:49 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
  1. パスワード不要でrootログインができるようになります。
$ mysql -u root
  1. 新しいパスワードに変更し、FLUSHします。
UPDATE mysql.user SET Password=PASSWORD('new password') WHERE User='root';
FLUSH PRIVILEGES;
  1. mysqldを再起動します。
$ mysql.server restart
is0me
ベトナムで働くエンジニア
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした