Support the ongoing development of Laravel.io →
posted 9 years ago
Database
Last updated 2 years ago.
0

Try

mysql -u username -p database_name < file.sql

via CLI.

Last updated 2 years ago.
0

Be careful with large sql files, it's might be better to split your sql dump, because there is an execution time limit.

Last updated 2 years ago.
0

And is there a way to import .sql-files inside PHP/Laravel?

Last updated 2 years ago.
0

I dump the SQL for the individual tables and then in seeders named appropriately I do:

public function run() { DB::unprepared(File::get('path/to/SQL/file')); }

Last updated 2 years ago.
0

psychonetic said:

Be careful with large sql files, it's might be better to split your sql dump, because there is an execution time limit.

via PMA yes, but not by CLI.

Sharping said:

And is there a way to import .sql-files inside PHP/Laravel?

http://php.net/manual/en/function.exec.php

Last updated 2 years ago.
0

if you want to convert to SQL migration laravel, use this.

http://adolfocuadros.com/sql_to_laravel/

0

How can i import mysql database into laravel 5.2?

Last updated 7 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Sharping sharping Joined 28 Jun 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.