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

Johnston907's avatar

Cannot make php artisan migrate work

Im trying to follow the laravel 5.4

from scratch video task by task. I am stuck on episode 4. I have Laravel, Valet, Composer, Php, mysql (on command line) and mySQLWorkbench. i use Atom as my IDE.

in ~/Desktop/Coding is where i saved all of my laravel/valet installations...my project is in ~/Desktop/coding/blog

i go into Atom and in /blog i have edited the env file to show the following:

DB_CONNECTION=mysql

DB_HOST=127.0.0.1

DB_PORT=3306

DB_DATABASE=blog10

DB_USERNAME=root

DB_PASSWORD=

i set DB_DATABASE to blog10 because i've tried this so many times, the most recent mysql database that i've created and used is blog10.

then in my terminal this is the status of the mysql database: mysql> status

mysql Ver 8.0.12 for osx10.13 on x86_64 (Homebrew)

Connection id: 18

Current database: blog10

Current user: root@localhost

SSL: Not in use

Current pager: stdout

Using outfile: ''

Using delimiter: ;

Server version: 8.0.12 Homebrew

Protocol version: 10

Connection: Localhost via UNIX socket

Server characterset: utf8

Db characterset: utf8

Client characterset: utf8mb4

Conn. characterset: utf8mb4

UNIX socket: /tmp/mysql.sock

Uptime: 8 hours 58 min 30 sec

In another page i type : Kyles-MBP:blog kylejohnston$ php artisan migrate

when i enter php artisan migrate, the command line has absolutely no response, i've even left it running overnight. I cannot type anything else into the command line until i hit control+c or start a new terminal window. If i misspell "migrate" the logs in my logs/laravel.log will update and my terminal will prompt me with an error message

I want the migrate to automatically make the two default tables in my blog10 database =[

0 likes
4 replies
Johnston907's avatar

oh and i can't get mySQLWorkbench to connect to it, either....

Johnston907's avatar

Could there possibly be version issues?

Kyles-MBP:blog kylejohnston$ php -v returns: PHP 7.2.8

Kyles-MBP:blog kylejohnston$ laravel -V returns: Laravel Installer 2.0.1

Kyles-MBP:blog kylejohnston$ valet -V returns : Laravel Valet 2.0.12

Kyles-MBP:blog kylejohnston$ composer -V returns: Composer version 1.6.5 2018-05-04 11:44:59

Kyles-MBP:blog kylejohnston$ brew -v returns: Homebrew 1.7.1

Kyles-MBP:blog kylejohnston$ mysql -V returns: mysql Ver 8.0.12 for osx10.13 on x86_64 (Homebrew)

Johnston907's avatar

So i got upset i couldn't solve this and moved onto something else. I tried creating a new user for mysql and in the process found a command specifying grants and permission related to mysql. When i created the new user with these grants and permission it solved every issue and everything works as intended. But why was it wrong in the first place?

Cruorzy's avatar

Could be anything always test your connections before you setup the rest, will help alot of useless debugging.

After setting up the sql server make sure its the connection type you want (socket/tcp) etc and try to connect. Create the database then go further

Please or to participate in this conversation.