LoginSignup
0
0

More than 1 year has passed since last update.

MariaDBのroot passwordをクリアする方法

Posted at

MariaDBのroot passwordをクリアする方法

設定ファイルにskip-grant-tables入れる

/etc/mysql/mariadb.conf.d/50-server.cnf

[mysqld]

の後に

skip-grant-tables

を追加

MariaDB再起動

service mysql restart

パスワードをクリア

mysql -u root
mysql> use mysql;
mysql> update user set password=password('') where user='root';
mysql> flush privileges;

設定ファイルを戻す

/etc/mysql/mariadb.conf.d/50-server.cnf に先ほど追加した skip-grant-tables をコメントアウト

[mysqld]
# skip-grant-tables

MariaDB再起動

service mysql restart

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0