手順は以下のとおり。
- mysqld起動時にskip-grant-tablesのオプションを渡す
- パスワードを設定し直す
- mysqldの再起動
起動時にskip-grant-tablesのオプションを渡す
mysqld_safeを使うなら$ mysqld_safe --defaults-file=/path/to/my.cnf --port=3306 --socket=/path/to/mysql.sock --old-passwords --datadir=/path/to/data --log-error=/path/to/mysqld.log --default-tabletype=InnoDB --skip-grant-tables
my.cnfに設定するなら
[mysqld] skip-grant-tables
パスワードを設定し直す
update mysql.user set Password=PASSWORD('passwd') where User='root';
0 件のコメント:
コメントを投稿