以下の手順でMySQLをインストールしたのですが、起動できません。
どのようにしたら良いでしょうか?
インストール:
$ sudo mysql80-community-source MySQL 8.0 Community enabled
$ yum install mysql-server
起動:
$ systemctl start mysqld
Failed to start mysqld.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and 'systemctl status mysqld.service' for details.
状態の確認:
[ec2-user ~]$ systemctl status mysqld.service
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Oct 01 18:44:54 ap-northeast-1.compute.internal systemd[1]: Starting MySQL Server...
Oct 01 18:45:22 ap-northeast-1.compute.internal systemd[1]: Started MySQL Server.
Oct 05 22:46:24 .ap-northeast-1.compute.internal systemd[1]: Stopping MySQL Server...
Oct 05 22:46:25 ap-northeast-1.compute.internal systemd[1]: Starting MySQL Server...
Oct 05 22:46:27 ap-northeast-1.compute.internal systemd[1]: Started MySQL Server.
Oct 05 22:51:51 ap-northeast-1.compute.internal systemd[1]: Stopping MySQL Server...
Oct 05 22:51:52 ap-northeast-1.compute.internal systemd[1]: Stopped MySQL Server.
sudo systemctl start mysqld
で起動確認できましたが、
mysql consoleを起動することができませんでした。
$ sudo grep 'temporary password' /var/log/mysqld.log
2020-05-31T13:56:58.175675Z 1 [Note] A temporary password is generated for root@localhost: ll!.iXg=K4Rr
[ec2-user ~]$ sudo mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)