php - Connecting to MySQL in brand new Laravel installation with Homestead unclear -


i have questions since new laravel/homestead environment.

question 1) in docs here, says homestead box comes mysql out of box. if go project/config/database.php file, can see there default details there mysql:

'mysql' => [             'driver'    => 'mysql',             'host'      => env('db_host', 'localhost'),             'database'  => env('db_database', 'forge'),             'username'  => env('db_username', 'forge'),             'password'  => env('db_password', ''),             'charset'   => 'utf8',             'collation' => 'utf8_unicode_ci',             'prefix'    => '',             'strict'    => false,         ], 

the thing whenever ssh box using homestead ssh , connect box, run command mysql , shows following:

error 1045 (28000): access denied user 'vagrant'@'localhost' (using password: no)

i don't know why not letting me enter mysql console. try mysql -u forge , shows me error above well. wondering why getting error , potentially how able fix it/successfully connect mysql console inside box.

question 2) interested in installing phpmyadmin.

i followed following thread (i followed second up-voted answer, since read somewhere if serve route in laravel, procedure of first answer in thread, kind of temporary , have every time halt/up box), did not work me. browser tries connecting phpmyadmin @ http://phpmyadmin.dev , doesn't work (the connection times out after while). made sure add phpmyadmin hosts file:

127.0.0.1 phpmyadmin.dev

as in homestead.yaml file:

sites:      -map: phpmyadmin.dev       to:  /home/vagrant/code/phpmyadmin 

i sure box mapping folders correctly since have other apps can connect in browser (for example test.app works perfectly)

question 3) wondering if can use mysql database have installed in local machine (not in vagrant/homestead box). if so, need set up? know easier, working mysql in box (which think make more sense, since whole point of having vagrant/homestead box isolate dev environment) or in local machine, or comes own choice.

thank advice/help in advance!

cheers!

question 1) turns out needed use credentials homestead username , secret password. after that, made modifications mysql databases.

question 2) using other thread on so, second up-voted answer, use phpmyadmin. not restarting homestead box, therefore not see changes. after restart, worked flawlessly.

question 3) sticking composer migrations 1 :)

thanks @jeemusu helping me out!

cheers!


Comments