Can't connect to local MySQL server error

Robson Roberto Souza Peixoto robsonpeixoto at gmail.com
Sun Aug 5 02:06:47 PDT 2012


On Sun, Aug 5, 2012 at 5:49 AM, Rodolfo Aramayo <raramayo at gmail.com> wrote:
> Answers below...
>
> On Sun, Aug 5, 2012 at 3:17 AM, Ryan Schmidt <ryandesign at macports.org> wrote:
>>
>> On Aug 5, 2012, at 02:05, Rodolfo Aramayo <raramayo at gmail.com> wrote:
>>
>>> I have followed the instructions outlined in the document:
>>>
>>> https://trac.macports.org/wiki/howto/MAMP
>>>
>>> And I can see my test web site and the output of phpinfo.php but I am
>>> consistently getting the following error:
>>>
>>> ERROR 2002 (HY000): Can't connect to local MySQL server through socket
>>> '/opt/local/var/run/mysql5/mysqld.sock' (2)
>>>
>>> which I have tried to correct unsuccessfully. Both mysql and php are
>>> pointing to the same directory: /opt/local/var/run/mysql5/
>>
>> You are trying to start the MySQL server provided by the mysql5 / mysql5-server ports, yes?
>
> Yes
>
>>
>> Is the server running? that is, is the mysqld process running, as seen using "ps" or Activity Monitor?
>
> Yes
>>
>> If not, does the MySQL log file say anything about why that is?
>
> No socket was being created.

Check if the /tmp/mysql.sock was being created.


> Now I had a "weird" experience:
>
> I had installed:
> mysql55
> mysql55-server
> mysql_select
>
> In addition to the
> mysql5 and
> mysql55-server
>
> I wasn't detecting this because the way "port search" was acting
>
> For example if I now search, I get:
>
>>port installed *mysql*
> None of the specified ports are installed.
>
>>port installed *mysql
> The following ports are currently installed:
>   p5.12-class-dbi-mysql @1.0.0_3 (active)
>   p5.12-datetime-format-mysql @0.40.0_3 (active)
>   p5.12-dbd-mysql @4.20.0_1+mysql5 (active)
>   php5-mysql @5.3.15_0+mysqlnd (active)
>
>>port installed mysql*
> None of the specified ports are installed.
>
>>port installed mysql
> None of the specified ports are installed.
>
>> port installed | grep mysql
>   mysql5 @5.1.63_0 (active)
>   mysql5-server @5.1.63_0 (active)
>   p5.12-class-dbi-mysql @1.0.0_3 (active)
>   p5.12-datetime-format-mysql @0.40.0_3 (active)
>   p5.12-dbd-mysql @4.20.0_1+mysql5 (active)
>   php5-mysql @5.3.15_0+mysqlnd (active)
>
> Note how this last one search is more complete
> I was using the command" >port installed *mysql*" before thus failing
> to detect that I had installed extra mysql ports
>
> I uninstalled mysql55, mysql55-server, mysql_ select AND uninstalled
> mysql5-server
> I then re-installed mysql5-server, re-booted and got the socket live
>
> But for a while I was under the impression the presence of the other
> mysql ports was interfering with the generation of the socket??
>
> So things are working now
>
> I need to learn where to place my wordpress (which is not up-to-date
> in MacPorts) and mantis installations now and learn where the mysql
> databases live inside the ports system which is something I was very
> familiar using the Apple standard system. Importantly I need to learn
> how not to kill the databases during upgrades
>
> THANKS
>
> --R
> _______________________________________________
> macports-users mailing list
> macports-users at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo/macports-users



-- 
Robson Roberto Souza Peixoto
Robinho
Master in Computer Science, University of Campinas
Linux Counter #395633
IRC: robsonpeixoto
Twitter: http://twitter.com/rrspba
github: https://github.com/robsonpeixoto


More information about the macports-users mailing list