user15879678
user15879678

Reputation: 1

Laravel pp db error ( the database name is incorrect

Good day this is the error i got when trying to run my laravel php artisan serve

The error i first got + the second error i got.

Not sure what to do?

Error Statement:

SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' error generated when running :127.0.0.1:8001

Solution tried:

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3630
DB_DATABASE=yourdbname
DB_USERNAME=admin
DB_PASSWORD=adminspassword

and

$ sudo mysql -u root
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'adminspassword';
GRANT ALL PRIVILEGES ON `*`.`*` TO 'admin'@'localhost';
FLUSH PRIVILEGES

Final Error Statment:

I got this

SQLSTATE[HY000] [1049] Unknown database 'laravel'

Upvotes: -1

Views: 92

Answers (1)

Daniel
Daniel

Reputation: 11

The problem is that you have not created a database.

So, what you need to do is:

sudo mysql
CREATE DATABASE yourdbname;

now you can start building user and permissions in the db.

Upvotes: 0

Related Questions