Access to the database created in XAMPP while working at Laravel 5

I am starting a large project in Laravel 5. In the past, I used XAMPP for all local work. Now we will work in Homestead. I launched Homestead and I downloaded the Laravel 5 project in it. works great.

For various reasons, we DO NOT want to use Laravel migrations, but use the MYb Workbench in combo with XAMPP-PHPMyAdmin to work with the mysql database. My question is: how can I access this mysql database from inside the Hostest VM?

I tried all kinds of settings in the /Config/database.php application. but no one works.

I examined related questions here, but no one seems to be answering my question: is it possible to access the remote database (or my machine) from the inside?

I read somewhere that I can create migrations from a SQL dump to duplicate the database in homestead using the package ( https://github.com/Xethron/migrations-generator ). using this as a workaround, I could connect my Laravel application to my database, which I installed in XAMPP, generated the migrations, and then reconnected to the DB Homestead and finally completed the migration. I think this might work, but I would prefer a direct connection. Any suggestions on how to connect to the database outside of Hostest VM are welcome.

+4
source share
2 answers

I'm also relatively new to Laravel and Homestead, but I'm in luck.

-, , MySQL Homestead, , . , "Homestead" " ssh" "".

mysql -u homestead -psecret dbname , XAMPP. Laravel, , .

VM ? XAMPP MySQL , , Vagrant VM. . , 192.168.1.196 - IP- /VM, MySQL, . XAMPP, Vagrant Homestead VM MySQL, , . "127.0.0.1" , , VM .

mysql -u user -ppassword dbname -h 192.168.1.196

, .

+1

< 1 > .env( laravel)

< 2 > DB_HOST IP- (- 198.168.0.11)

DB_HOST = lan_ip

< 3 > phpmyadmin

any_host ( )

0

All Articles