Vagrant MySQL Access

2019-08-18 06:43发布

问题:

So I am new to this vagrant vm creation (and am really liking it). I am using puphpet to make the config. Everything is working great. Access to the shared folders, ssh and access to the website (Apache server).

The last piece I cannot seem to get figured out is the database part. When using php I can connect but to do the actual development on my database I prefer to use sqldeveloper (I have tried workbench). No matter what I enter I cannot seem to get a connection. No matter the user ip or name it does not go anywhere.

I have tried 127.0.0.1 and 192.168.56.100 <= VM ip

Port is 3306 (as far as I know) I did not modify this as far as I know.

I am not sure what information would be helpful here so please let me know.

I have seen something about updating the my.cnf, binding addresses and updating user privileges but that was argued in a couple other articles I have seen.

Just want to check because I am also making the documentation that will be used for setup.

If the above steps are needed is there anyway to automate it?

回答1:

You have to forward the port in Puphpet you had to do this so that your server can talk to port 80. You must do the same for anything else you do. So for you to access 3306 you need to have it foward inside the config. You can open up the existing config with any editors.