Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Problem logging to mysql

Mysql was working fine, but suddenly I got a message "#2002 Cannot log in to the MySQL server"
I looked into mysql documentation and it seems to a socket error.
Any idea how to fix it?

Thanks in advance.

MacBookpro 17", Mac OS X (10.6.3)

Posted on Jun 4, 2010 8:14 AM

Reply
12 replies

Jun 4, 2010 11:12 AM in response to alkhater

On that socket error and loading you mentioned, you have to go back to the original setup you did with mysql.sock See:http://superfancy.net/coding/php-mysql-apache-in-mac-osx-leopard/ But then you can start mysql with: sudo /usr/local/mysql/support-files/mysql.server start I don't know if this will help or rectify your problem due to what I have gathered from your posts. You ought to start back at ground zero as strongly suggested by others. But you wont. Good luck.

Jun 4, 2010 6:59 PM in response to ericmeyers

Hi ericmeyers,
I have installed mysql-5.5.2-m2-osx10.6-x86.dmg package.


Hi doug pennington,

I have followed http://superfancy.net/coding/php-mysql-apache-in-mac-osx-leopard/
which was an excellent article except I got stock when I looked at /etc and could not find sql.sock

By the way before I removed MAMP I got it working. I can go back and re-install it, but I want to figure out why the Mac version is not working.

Jun 4, 2010 8:09 PM in response to alkhater

alkhater wrote:
I have followed http://superfancy.net/coding/php-mysql-apache-in-mac-osx-leopard/
which was an excellent article except I got stock when I looked at /etc and could not find sql.sock


But that site is almost two years old. Plus, it was probably old information when it was written. My Apache/PHP/MySQL work just great but I've only done a fraction of what is listed on that page. I think it was correct circa 2007 or so, but I wouldn't follow it today on a 10.6 system.

Unfortunately, at some point about a year ago, maybe earlier, the internet stopped being a source of information and has become a source of misinformation. There is more information that is flat out wrong than there is that is correct. If you aren't a real greybeard computer geek, how can you tell?

I recommend undoing everything you did on that page to get your computer back to its original configuration. I don't have a php.ini nor any my.cnf files. I never work with UNIX configurations from the Finder. I don't trust that Finder tools with set the permissions correctly. I always use the command line and vi. I did enable the PHP modules in the Apache config file, but that is it. There are better ways to setup virtual hosts.

You have already jacked up your system, so you are going to have to do some extra work to get it functional again. We will be glad to help, but you are going to have to learn some additional things on your own. A good place to start is to learn your way around the Console.app program so you can review log files. In the end, you will wind up knowing more about all these tools that the average person and you will have earned that knowledge 🙂

Problem logging to mysql

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.