Laravel Connecting to MySQL database - Laravel 5


How to connect Laravel with MySQL Database


Laravel makes connecting with MySQL databases and running queries extremely simple out of the box. The MySQL database configuration for your application is located at Laravel Project Root Folder, config/database.php. In this file you may define MySQL database connection for your Laravel Application.

'mysql' => [
    'driver' => 'mysql',
    'host' => env('DB_HOST', '127.0.0.1'),      // usually localhost, or mysql database server ip address
    'port' => env('DB_PORT', '3306'),           // default port 3306, or mention port in which it run on your server if it different
    'database' => env('DB_DATABASE', 'forge'),  // mention your mysql database name here  
    'username' => env('DB_USERNAME', 'forge'),  // mention your mysql database privileged user name 
    'password' => env('DB_PASSWORD', ''),       // password of your mysql database user
    'charset' => 'utf8mb4',                     // your mysql database charset  
    'collation' => 'utf8mb4_unicode_ci',        // your mysql database collation 
    'prefix' => '',
    'strict' => true,
    'engine' => null,
],


if you have any questions regarding Laravel MySQL database connection,  please feel free to leave your comment bellow.

Written by Akram Wahid 6 years ago

are you looking for a chief cook who can well craft laravel and vuejs, to make some awsome butterscotch,
yes then it is right time for you to look at my profile.

Do you want to write Response or Comment?

You must be a member of techalyst to proceed!

Continue with your Email ? Sign up / log in

Responses

Be the first one to write a response :(

{{ item.member.name }} - {{ item.created_at_human_readable }}

{{ reply.member.name }} - {{ reply.created_at_human_readable }}