I had the same problem; this is how i resolve it
I was developing a laravel 4.2 project with WampServer as a development environment, later I decided to switch to laravel homestead as a development environment
Steps:
Save your database as a .sql file (my case: exported from phpMyAdmin and saved as db.sql)
Put the .sql file in the root of your project
Go to your farm directory
C:\Users\chebaby\Homestead (master)
Enter the stray box
vagrant ssh
Go to the project root in the field (where you saved the early darabase.sql file in my case: db.sql)
vagrant@homestead:~$ cd Code/project-folder/
Login to mysql
vagrant@homestead:~/Code/project-folder$ mysql --user=homestead --password=secret
to check if your database exists.
mysql> show databases;
Just create your database by running this command
mysql> create database yourdatabasename;
Now that you are sure that your database is created, exit mysql back to the abusive prompt
mysql> exit;
Imports a database file by running this
vagrant@homestead:~/Code/project-folder$ mysql --user=homestead --password=secret yourdatabasename < db.sql
All you have to do is check if your existing database has been imported successfully
Login to mysql
vagrant@homestead:~/Code/project-folder$ mysql --user=homestead --password=secret
then run
mysql> use yourdatabasename
To show running tables
mysql> show tables;
hope this answers your question
Additional resources
Laravel Homestead - default MySQL credentials and database
How to import SQL file using command line in MySQL?