MariaDB/rootでログインできない場合の設定
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#navi(../)
* sudoなしだとrootでログインできない場合の対処 [#a4aedca5]
本資料では、MariaDBをインストールし mysql_secure_installa...
$ mysql -u root -h localhost -p
Enter password:
ERROR 1698 (28000): Access denied for user 'root'@'local...
#contents
#htmlinsert(db-top.html)
* 動作確認環境 [#b8745f93]
- Ubutnu 20.04 (Ubuntu MATE 利用)
- MariaDB
MariaDB [(none)]> select version();
+--------------------------+
| version() |
+--------------------------+
| 10.3.22-MariaDB-1ubuntu1 |
+--------------------------+
* インストール直後の動作確認 [#x6a0df71]
aptコマンドで以下のようにMariaDBをインストールし、mysql_s...
sudoを使えばログインできますが、sudoなしの場合は Access d...
$ mysql -u root
ERROR 1698 (28000): Access denied for user 'root'@'local...
$ sudo mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or ...
Your MariaDB connection id is 56
Server version: 10.3.22-MariaDB-1ubuntu1 Ubuntu 20.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab...
Type 'help;' or '\h' for help. Type '\c' to clear the cu...
MariaDB [(none)]>
* sudoなしで mysql -u root -p が動作するようにする [#ab8a...
以下の手順でsudoなしで接続できることを確認しました。
+ MariaDBに接続
sudo mysql -u root
+ 接続されたら、以下のSQLを実行します。~
パスワード部分 sakura を皆さんの環境に合わせて変更してく...
grant all privileges on *.* to root@localhost identified...
#br
flush privileges;
#br
exit
#br
sudoなしで再度MariaDBに接続します。
$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or ...
Your MariaDB connection id is 77
Server version: 10.3.22-MariaDB-1ubuntu1 Ubuntu 20.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab...
Type 'help;' or '\h' for help. Type '\c' to clear the cu...
MariaDB [(none)]>
上記の通り、sudoなしで接続できました。
終了行:
#navi(../)
* sudoなしだとrootでログインできない場合の対処 [#a4aedca5]
本資料では、MariaDBをインストールし mysql_secure_installa...
$ mysql -u root -h localhost -p
Enter password:
ERROR 1698 (28000): Access denied for user 'root'@'local...
#contents
#htmlinsert(db-top.html)
* 動作確認環境 [#b8745f93]
- Ubutnu 20.04 (Ubuntu MATE 利用)
- MariaDB
MariaDB [(none)]> select version();
+--------------------------+
| version() |
+--------------------------+
| 10.3.22-MariaDB-1ubuntu1 |
+--------------------------+
* インストール直後の動作確認 [#x6a0df71]
aptコマンドで以下のようにMariaDBをインストールし、mysql_s...
sudoを使えばログインできますが、sudoなしの場合は Access d...
$ mysql -u root
ERROR 1698 (28000): Access denied for user 'root'@'local...
$ sudo mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or ...
Your MariaDB connection id is 56
Server version: 10.3.22-MariaDB-1ubuntu1 Ubuntu 20.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab...
Type 'help;' or '\h' for help. Type '\c' to clear the cu...
MariaDB [(none)]>
* sudoなしで mysql -u root -p が動作するようにする [#ab8a...
以下の手順でsudoなしで接続できることを確認しました。
+ MariaDBに接続
sudo mysql -u root
+ 接続されたら、以下のSQLを実行します。~
パスワード部分 sakura を皆さんの環境に合わせて変更してく...
grant all privileges on *.* to root@localhost identified...
#br
flush privileges;
#br
exit
#br
sudoなしで再度MariaDBに接続します。
$ mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or ...
Your MariaDB connection id is 77
Server version: 10.3.22-MariaDB-1ubuntu1 Ubuntu 20.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab...
Type 'help;' or '\h' for help. Type '\c' to clear the cu...
MariaDB [(none)]>
上記の通り、sudoなしで接続できました。
ページ名: