mysql.sock does not exist!

I'm trying to set up mysql. So I went and installed phpmyadmin and it set up without any errors. But when I go to log into it, it gives me error #2002 Cannot log into mysql server. I read that this was because it couldn't access mysql.sock, and sure enough it was looking for the file in /var/mysql/mysql.sock

Unfortunatly for me, the directory /var/mysql does not exist. I thought I would try to install a later version from mysql.com, but it told me to stop all other instances of mysql with this command. I ran that command, and it said "Cannot connect to local MySQL server through socket '/var/mysql/mysql.sock'" !!!!!

I could go ahead and try to install a new version of MySQL, but it said it would install the sock file in this other folder. (/tmp/mysql.sock) If I do that, I would have to change a bunch of config files to point to this new location, and I don't really know what things need that and what things don't. (I'm kindof new to server management)

So my question is: Why is mysql.sock not in /var/mysql/ and how do I get it there? I ran locate "mysql.sock" and it returned no results.

I'm using the stock versions of everything on Mac os X server 10.6.5

iMac, Mac OS X (10.6.4), iPhone 3G, Wifi iPad

Posted on Jan 2, 2011 11:20 AM

Reply
7 replies

Jan 2, 2011 2:30 PM in response to Macoder

Are you using Terminal.app and a terminal session?

The Mac OS X Server version of MySQL is usually configured and started via the Server Admin tool.

The /var/mysql directory exists on the server systems I'm using (checked a couple of 10.6.5 boxes), so I don't know what has happened with your configuration and your testing. And yes, there's a mysql.sock file located there.

Have there been other changes to the local configuration? In particular, if you've now got two versions of MySQL installed, you're probably going to have collisions and issues until that gets untangled. (Do you have a backup created from before you installed the second MySQL instance?)

Jan 2, 2011 2:43 PM in response to MrHoffman

Hi Mr Hoffman. 🙂

I am using a terminal session to do this. Its the only way I'm familiar of since this is the first non-linux system I've set up to host a website. I looked in server admin, but I don't see a way of controlling mySQL anywhere there. I'll check out some support pages though, it's probably right under my nose.

I haven't installed the newer copy of mySQL yet though. I'm using the default settings for everything on the mac (I just enabled php) and all the stock software.

Message was edited by: Macoder

Jan 2, 2011 4:07 PM in response to Macoder

Unix boxes differ from one to the other, though most will follow POSIX norms.

Mac OS X Server is usually GUI-managed, and going after the configuration files directly can potentially derail the GUI interfaces. FWIW. Experienced Unix users can and do go after the various files directly, of course, and there are some management operations that require the terminal.

Here are [the Apple Mac OS X Server manuals|http://www.apple.com/server/macosx/resources/documentation.html]. They're a good introduction to what's available and how to manage it.

As for your question (and if I've guessed what's going on here correctly), launch Server Admin > select the server > select Settings > Services > check the MySQL box to enable and Save. Then select MySQL from the list of services offered, and view its settings and reset your password, Save, and then start it.

Jan 3, 2011 4:23 PM in response to Macoder

How a server is secured depends on the local configuration and requirements.

Blocking access to this particular tool might involve putting the tool on a separate Site on a different IP port and not passing that port through the firewall, or blocking access to the tool via rewrite rules, or setting up an http-level password.

[Here is one thread on this topic|http://stackoverflow.com/questions/2631269/how-to-secure-phpmyadmin], or [here|http://www.phpbuilder.com/board/showthread.php?t=7109220], and particularly see the last part of the [phpMyAdmin Official Quick Install documentation|http://www.phpmyadmin.net/documentation>.

There are some specific recommendations in the phpMyAdmin tool, including +You should deny access to the ./libraries and ./setup/lib subfolders in your webserver configuration. For Apache you can use supplied .htaccess file in that folder, for other webservers, you should configure this yourself. Such configuration prevents from possible path exposure and cross side scripting vulnerabilities that might happen to be found in that code.+

I've seen all manner of access attempts and injection attacks attempted against that tool, too; there was a barrage of attempts earlier today on one of my servers.

And FWIW, I tend to use the command line tools, or the Sequel Pro tool.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

mysql.sock does not exist!

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