Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Steady-Entertainment's avatar

php artisan migrate ERROR

I am setting up a new macbook pro

php artisan migrate

returns the following ERROR

Illuminate\Database\QueryException

  SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' (SQL: select * from information_schema.tables where table_schema =  and table_name = migrations and table_type = 'BASE TABLE')

strange thing is that this command doesn't work

mysql -uroot -p

instead I have to use

sudo mysql -uroot -p

or just

mysql

once I am logged into mysql I create a database named "pool"

my .env looks like this

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=pool
DB_USERNAME=root
DB_PASSWORD=

I found a lot of threads regarding this topic:

php artisan config:clear
php artisan cache:clear
php artisan config:cache

didn't help

I had maria DB installed

brew install maraiadb

and then i de installed it

now when I do

brew search mysql

I have mysql and [email protected] installed

these are my sql users

mysql> SELECT user, host FROM mysql.user;
+-------------+---------------------------+
| User        | Host                      |
+-------------+---------------------------+
|             | localhost                 |
| mariadb.sys | localhost                 |
| reniar      | localhost                 |
| root        | localhost                 |
|             | reniars-macbook-pro.local |
+-------------+---------------------------+
5 rows in set (0.00 sec)
0 likes
10 replies
MichalOravec's avatar

It seems that you installed mysql later, so restart you local server.

Steady-Entertainment's avatar

I tried ...

brew services restart mysql
==> Successfully started `mysql` (label: homebrew.mxcl.mysql)

but same results

Steady-Entertainment's avatar

I dont know why there is mariaDB listed as a server version.

Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 35

Server version: 5.5.5-10.4.13-MariaDB Homebrew

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Steady-Entertainment's avatar

When I use

/usr/local/bin/mysql.server restart

I get

Shutting down MySQL
.. ERROR! The server quit without updating PID file (/usr/local/var/mysql/reniars-MacBook-Pro.local.pid).
 ERROR! Failed to stop running server, so refusing to try to start.
Steady-Entertainment's avatar

it seems the server is running on reniars mac book pro and not on localhost is that possible?

Please or to participate in this conversation.