version / 5.7.31-0ubuntu0.16.04.1
リモート接続先のMySQLを再起動しようとしたら「Access denied」が表示されました。
$ service mysqld stop polkit-agent-helper-1: pam_authenticate failed: Authentication failure ==== AUTHENTICATION FAILED === Failed to stop mysqld.service: Access denied See system logs and 'systemctl status mysqld.service' for details.
rootユーザでログインしているのに再起動できないのは何故なのでしょうか?
何かヒントだけでも教えていただけると幸いです。
宜しくお願い致します。
試したこと
エラーメッセージにあるlogを確認しようとしましたが、「Permission denied」になってしまい確認出来ませんでした。
$ ls /var/log/mysql ls: cannot open directory '/var/log/mysql': Permission denied
user確認しました。
この辺りが関連してるのでしょうか?
$ cat /etc/mysql/mysql.conf.d/mysqld.cnf [mysqld] # # * Basic Settings # user = mysql
追記
やってる事は一緒ですがエラーメッセージが変わりました。
t_satou@ip-17x-xx-xx-xxx:~$ sudo service mysqld stop Failed to stop mysqld.service: Unit mysqld.service not loaded. t_satou@ip-17x-xx-xx-xxx:~$
MyASQLが起動してない?
いや接続は出来てますが・・・
$ sudo su - hoge $ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 179 Server version: 5.7.31-0ubuntu0.16.04.1 (Ubuntu) Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
sudoつけて実行するとどうですか?
rootになった上で
sudoを付けて実行しました。
hoge@ip-17x-xx-xx-xxx::~$sudo service mysqld stop
[sudo] password for spacee:
Sorry, try again.
root(hoge)のパスワードやMySQLのを入れましたが、ダメでした。
rootになる前に実行。
t_satou@ip-17x-xx-xx-xxx:~$ sudo service mysqld stop
[sudo] password for t_satou:
Failed to stop mysqld.service: Unit mysqld.service not loaded.

回答2件
あなたの回答
tips
プレビュー