Laravel valet MySQL - PHP Artisan migrate stuck, no response
Recently I installed Laravel valet on my Mac. I want to use MySQL and went to the section "database" in the Laravel Valet documentation. There it says the following:
If you need a database, try MySQL by running brew install [email protected] on your command line. Once MySQL has been installed, you may start it using the brew services start [email protected] command. You can then connect to the database at 127.0.0.1 using the root username and an empty string for the password.
I followed the exact steps and made a connection via the build-in database tool in PHPStorm, which went fine.
I looked at my .env file and it contains the right data
Hey @Nakov, It shows the right port. The command is just stuck forever, I left it on for more than 2 hours and nothing. I tried changing it to localhost but no luck.
@nakov I removed mysql by doing brew services stop mysql, brew unlink mysql and brew uninstall mysql and downloaded the .dmg file from Oracles website. Now whenever I want to do mysql -u root it says ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) and I can't connect anymore via the build-in database tool in PHPStorm while using the right password. which is rootroot. I updated my .env file and tried it all again but with no luck
Edit:: php artisan migrate now gives this:
Access denied for user 'root'@'localhost' (using password: YES) (SQL: select * from information_schema.tables where table_schema = rainierlaan and table_name = migrations and table_type = 'BASE TABLE')
I followed the exact steps and again with no luck. I turned off MySQL server and ran the command and proceeded to connect to my database but can't
rainierlaan@MacBook-Pro-van-Rainier rainierlaan % sudo mysqld_safe --skip-grand-tables
Logging to '/usr/local/mysql/data/MacBook-Pro-van-Rainier.local.err'.
2019-12-28T15:31:35.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
2019-12-28T15:31:37.6NZ mysqld_safe mysqld from pid file /usr/local/mysql/data/MacBook-Pro-van-Rainier.local.pid ended
rainierlaan@MacBook-Pro-van-Rainier rainierlaan % mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
rainierlaan@MacBook-Pro-van-Rainier rainierlaan % mysql -u root root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
rainierlaan@MacBook-Pro-van-Rainier rainierlaan %
@rainieren Are you sure you've setup a password when you installed it, because by default it has just a root user and no password.
If you did, then try reinstalling again, don't know what else to tell you. Btw, for each step that you have shown me I googled the error, so many responses. So use that as well.