I have some questions since I am new to the Laravel/Homestead environment.
Question 1) In the docs here, it says that the homestead box comes with MySQL out of the box. If I go to my project/config/database.php
file, I can see that there are some default details already there for 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 is that whenever I SSH into my box using homestead ssh
and I successfully connect to my box, I run the command mysql
and it shows the following:
ERROR 1045 (28000): Access denied for user 'vagrant'@'localhost' (using password: NO)
I don't know why it is not letting me enter the mysql console. I even try mysql -u forge
and it shows me the error above as well. I was wondering why am I getting this error and potentially how would I be able to fix it/successfully connect to the mysql console inside my box.
Question 2) I am really interested in installing phpMyAdmin.
I followed the following thread (I followed the second most up-voted answer, since I read somewhere that if you serve
a route in laravel, like the procedure of the first answer in the thread, it is kind of temporary and you would have to do it every time you halt/up the box), but it did not work for me. My browser just tries connecting to phpmyadmin @ http://phpmyadmin.dev
and it just doesn't work (the connection times out after a while). I made sure to add phpmyadmin into my hosts file:
127.0.0.1 phpmyadmin.dev
as well as in my homestead.yaml file:
sites:
-map: phpmyadmin.dev
to: /home/vagrant/Code/phpmyadmin
I am sure that my box is mapping folders correctly since I have other apps that I can successfully connect to in my browser (for example test.app
works perfectly)
Question 3) I was wondering if I can use a MySQL database I have installed in my local machine (not in my vagrant/homestead box). If so, what would I need to set up? I would also like to know what would be easier, working with MySQL in the box (which I think it would make more sense, since the whole point of having a vagrant/homestead box is to isolate your dev environment) or in my local machine, or it just comes up to your own choice.
Thank you for all your advice/help in advance!
Cheers!