0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Access denied for user 'root'@'localhost' (using password: NO) エラーの対処

Last updated at Posted at 2021-03-13

対象

  • CentOS 7
  • Mysql Ver 8.0.23 for Linux on x86_64
確認方法
# OS確認
$ cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)

# MySQL確認
$ mysql --version
mysql  Ver 8.0.23 for Linux on x86_64 (MySQL Community Server - GPL)

エラー内容

$ mysql -u root -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

'root'@'localhost'のパスを確認してみる

cat /var/log/mysqld.log | grep root
2021-03-13T10:37:21.641762Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: kjdgxz#G89 

最後に表示された文字列がパスワードです。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?