Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add new database user in homestead.yaml

I've specified a second database in my homestead.yaml file and this gets created without a hitch, but it uses the default homestead database user.

Is it possible to also include a new user in homestead.yaml, or is this something I just need to do manually after the vagrant instance is up and running? I didn't notice anything in the docs about this.

It's a Postgres database if that makes any difference.

like image 678
Steve Holland Avatar asked Mar 25 '15 14:03

Steve Holland


People also ask

How do I connect to Homestead database?

Connecting To Your Databases To connect to your MySQL or Postgres database from your main machine via Navicat or Sequel Pro, you should connect to 127.0. 0.1 and port 33060 (MySQL) or 54320 (Postgres). The username and password for both databases is homestead / secret .

How do I update my homestead?

Updating Homestead You can find the latest stable release version on Homestead's GitHub releases page. After updating the Vagrant box, you should run the bash init.sh command from the Homestead directory in order to update Homestead's additional configuration files.


1 Answers

You can't do this from the yaml file. Alternatively you can write the commands to create the user in after.sh file inside the .homestead folder. This way after the virtual machine is created, it will get executed automatically and your new user will be ready, without you doing it manually.

like image 127
Sameer Avatar answered Sep 21 '22 17:09

Sameer