Vagrant-Laravel-Stack icon indicating copy to clipboard operation
Vagrant-Laravel-Stack copied to clipboard

MySQL-Server not reachable

Open chrischnweiss opened this issue 10 years ago • 8 comments

Hey,

after running 'vagrant up' and provisioning the machine, the MySQL-Server seems to be not reachable from Laravel.

A portscan to the machines-ip told me, that there is no open port 3306. Anyone else with this problem?

Greetings

chrischnweiss avatar Mar 04 '14 07:03 chrischnweiss

After changing db-configuration from ip to localhost i got the following error-message: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

chrischnweiss avatar Mar 04 '14 07:03 chrischnweiss

Ok, looking for the running MySQL-server ends up in the awareness that there is no MySQL-server running.

chrischnweiss avatar Mar 04 '14 07:03 chrischnweiss

I destroyed the machine again yesterday and ran vagrant up again. After that, the MySQL-server works fine but when I halt the machine and start it up again the MySQL-server is again not reachable. Any other users with this issue?

chrischnweiss avatar Mar 05 '14 08:03 chrischnweiss

Have you tried to just restart the MySQL server manually?

sudo service mysqld restart

I can also highly recommend doing vagrant suspend instead of vagrant halt as that will just "pause" the machine and save the current state to the disk.

MiniCodeMonkey avatar Mar 05 '14 14:03 MiniCodeMonkey

With 'vagrant suspend' everything works fine.

No I only have the problem that I can't connect to the database with Sequel-SQL client. The access from outside of the machine seems to be blocked. A portscan to 172.22.22.22 or 'name-of-my-project'.local answers that there is no port 3306 is open.

chrischnweiss avatar Mar 06 '14 07:03 chrischnweiss

I'm having both issues, the socket error and also when I try to connect to the database through Sequel.

I tried restarting the MySQL server manually (mysqld didn't work, had to be mysql)...

HelloTiago avatar Mar 06 '14 17:03 HelloTiago

I've had the same issue as well, I instead did a vagrant destroy and re-built the machine after wasting an hour trying to figure things out.

denisinla avatar Mar 18 '14 22:03 denisinla

I've the same issue. The command 'service mysql status' by ssh => mysql stop/waiting No possible to restart mysql : the command 'service mysql start' => start: Rejected send message, 1 matched rules; type="method_call", sender=":1.3" (uid=1000 pid=1965 comm="start mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")

I use too vagrant-phpstorm-tunnel plugin, i loose in the same time, the tunnel between PhPStorm and Vagrant machine.

CapitaineExpert avatar Mar 18 '14 22:03 CapitaineExpert