hafixihe's avatar

Valet and connecting to database.

In the docs you can find that you can connect to the database using the root user and 127.0.0.1. Can I connect to the database through the browser? How else can I connect?

0 likes
1 reply
bobbybouwmann's avatar
Level 88

Laravel Valet assumes that you have a mysql server running yourself locally. You can't connect to the database by default. If you want that you need to install a tool like PHPMyAdmin. In general just putting 127.0.0.1 in the .env for the DB_HOST key should be enough to make your application connect to your local database.

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.

Documentation: https://laravel.com/docs/6.x/valet#installation

3 likes

Please or to participate in this conversation.