Access denied for user 'root'@'localhost' Laravel on ubuntu 18.04

rQwk

I have a problem with laravel and mysql. It is possible for me to php artisan migrate and seed my database. But on the other side accessing to a page using the database is impossible for me. I receive the following error:

SQLSTATE[HY000][1698] Access denied for user 'root' @'localhost' (SQL: select * from `users`)

My .env is correctly filled in (I can migrate without worries)

My application runs under a ubuntu 18.04.

Does anyone have any idea where this might come from?

Kapitan Teemo

The root user in mysql 5.7 now requires sudo. That means phpMyAdmin will not be able to use mysql -u root anymore instead use sudo mysql -u root credentials.

What you need to do is create a new user with the same privileges as the root credentials and use that instead.

Here's how you can do it.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

ERROR 1698 (28000): Access denied for user 'root'@'localhost' at Ubuntu 18.04

ampps/Laravel5: error:Access denied for user 'root'@'localhost'

Laravel 5.4 access denied for user root@localhost on migrate

mysql error Access denied for user 'root'@'localhost'

MySQL Error: : 'Access denied for user 'root'@'localhost'

Access denied for user 'root'@'localhost' from servlet

Access denied for user 'root'@'localhost' in the mysql docker

Access denied for user 'root'@'localhost' to database 'drupal'

Access denied for user root@localhost

Access denied for user 'user'@'localhost' Laravel 5.8

Laravel Access denied for user 'root'@'localhost' (using password: YES) in laravel 4.2

Laravel Access denied for user 'root'@'localhost' (using password: YES) in laravel 5.7

Laravel: Access denied for user homestead at localhost

Access denied for user ''@'localhost' to database laravel

I got ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) with the command sudo mysql on ubuntu

#1698 - Access denied for user 'root'@'localhost' mysql -5.7 and ubuntu-16.04

Laravel auth: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)

Access denied for user 'root '@'localhost' " when connecting to mysql

Access Denied for User 'root'@'localhost' (using password: YES) - No Privileges?

Access denied for user 'root'@'localhost' with certain passwords only

MySQL said: Access denied for user 'root'@'localhost' (using password: NO)"

OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: YES)")

How to query mysql Kubernetes pod? Access denied for user 'root'@'localhost'

Rails app denied access to mysql for user root @ localhost

ERROR 1698 (28000): Access denied for user 'root'@'localhost'

error: 'Access denied for user 'root'@'localhost' (using password: YES)'

Stuck with Access Denied for user 'root'@'localhost' - Terminal, Mac

mysql_connect(): Access denied for user 'root'@'localhost'

Mysql: Access denied for user 'root'@'localhost' right after installation on macOS