PHP Fundamentals - lesson 7.1 problems accessing mysql server

Hi everybody,

I’m following de “PHP Fundamentals” course and I’m stucked in lesson 7.1. I’m actually using docker for apache php and mysql services and not MAMP like in the video and I’m not able to connect to mysql from my php code. I followed the 7.1 lesson video instructions to solve the “could not connect” problem (min 3 to 5 of the video) and it’s not working for me, here I paste the results of the commands suggested by the video to retreive information about php in my computer:

tricoman@Kepler:~$ php -v
PHP 7.0.8-0ubuntu0.16.04.2 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.8-0ubuntu0.16.04.2, Copyright (c) 1999-2016, by Zend Technologies

I tried to find the path to my docker’s php installation to get the php version is running in it but I’ve not been able to get this, so I used the “echo phpinfo();” to get the php version my server is using and this is the result:

Then I tried to get the “mysql.sock” path information mentioned in the video and this is the path that appears in the phpinfo file:

For the last I ran this command without result:

tricoman@Kepler:~$ php -i | grep mysql.sock
tricoman@Kepler:~$ 

So I can’t get the mysql.sock real path.

Any idea what else must I check to configure the access to mysql server properly?

Thanks a lot for your attention,
Grettings

I do see a myslqd.sock file at /var/run/mysqld/mysqld.sock - have you tried to use that one instead?