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 1 year has passed since last update.

【Laravel】SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' が出た時の解決方法

Last updated at Posted at 2022-10-20

【Laravel】SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' が出た時の解決方法

解決方法:
新しいデータベースuserを作ろう!

❶rootユーザーでmysqlに入る↓

ユーザー作成:
MariaDB [(none)]> CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';

権限付与:
MariaDB [(none)]> GRANT ALL ON *.* TO "sample_user"@"localhost";

❷新しく作ったユーザーでmysqlに入る↓
データベース作成:
CREATE DATABASE newdatabase;

❸.envを修正

❹完了!

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?