5
2

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.

SQLSTATE[HY000] [1044] Access denied for user の解決方法

Last updated at Posted at 2020-05-02

#はじめに
dotinstallでPHPのtodoアプリを作っていた時に以下のようなエラーが出たので解決方法を載せておきます。

SQLSTATE[HY000] [1044] Access denied for user 'dbuser'@'localhost' to database 'dotinstall_todo_app'

#原因
ユーザーに権限を譲渡する時に以下のようにユーザー名を間違えて譲渡したことでエラーが出ていた

[vagrant@localhost]$create user dbuser
[vagrant@localhost]$create database dotinstall_todo_app
[vagrant@localhost]$grant all on dotinstall_todo_app.* to dbuserr;

#解決方法
以下のようにもう一度設定し直したらエラーが解決できました

[vagrant@localhost]grant all on dotinstall_todo_app.* to dbuser;

以上です

5
2
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
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?