4

I'm new to all this artisan stuff. When I start my php server with

$ php artisan serve 

How do I get the mysql server to run?

3 Answers 3

5

The MySQL server is independent of Laravel. The artisan command is just an interface to Laravel which runs PHP scripts in the background.

To start your MySQL server on Linux, you will have to run something like

sudo service mysql start

For Windows, you will get access to the server via WAMP or from the installed services.

Sign up to request clarification or add additional context in comments.

Comments

0

actually if you want to modify a little bit of laravel framework , you can do it like this:

open ServeCommand.php file on /vendor/laravel/framework/src/Illuminate/Foundation/Console/ServeCommand.php

then locate to serverCommand() function

add this command

echo shell_exec('sh your_terminal_command_to_start_mysql ');

everytime you run php artisan serve it will also execute your mysql service start command

Comments

0

For Windows or Mac, you will need XAMPP installed to initiate MySQL. https://www.apachefriends.org

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.