I am unable to start MySQL Server on Mac OSx Mountain Lion. This may be because there's no file named as 'mysql.sock' anymore. On running mysql command on terminal i get
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
MySql server was running fine on my machine for a long time before this issue. What could be causing this error ?
Update :
i have tried running mysqld_safe but no use and then running '/usr/local/mysql-5.6.12-osx10.7-x86_64/scripts/mysql_install_db' but this is what i get
FATAL ERROR: Could not find ./bin/my_print_defaults
If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.
Related
I've run into a problem here, and I'm not sure what to do. I migrated a Yosemite Mac to a new Mac Pro. Apache turns on, but MySql does not with this error: The operation couldn’t be completed. (XAMPPErrorDomain error 1.)
I didn't know if I need to reinstall MySql or upgrade it, or what this error means. I created the plist file as in the example and ran permissions, but that did not change the outcome. Going to websites in localhost, WordPress shows an error establishing db connection.
I went to Github to install MySql and it went fine, but it does not work with Xampp and Desktop Server. I chose to NOT start MySql when I rebooted, but apparently the Github version started anyway (and I cannot find a way to turn it off!) Now when I try to start MySql from Xampp, it says another version is already running.
Any help appreciated.
When I ask for version number in terminal I get this response:
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
HOWEVER, when I went to /var/ and temp I found an alias for mysql.sock, BUT it was not connected to an original file... Now that file does not exist anywhere on my computer.
Open /Applications/XAMPP/xamppfiles/xampp and add this line somewhere at the top:
unset DYLD_LIBRARY_PATH
I found that what was required was a complete uninstall of MySql following this procedure: http://bytearrays.com/completely-uninstall-mysql-mac-osx/
And then a reinstall. ServerPress.com was very helpful in diagnosing the problems.
I love the conveniences of MAMP e.g. phpMyAdmin so I installed it.
I also installed MySQL via Home Brew because I need MySQL command line (mainly for import and export).
Now entering mysql results in:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
What should I do?
The MAMP mysql socket is located elsewhere. If you installed MAMP and own mysql parallel, you have two instances.
One with MAMP context, which has its binary in
/Applications/MAMP/Library/bin/
Other one depending on your settings during install.
Make sure to start mysql (the one you would like to work with).
You might want to use command line as follows:
/Applications/MAMP/Library/bin/mysql [command goes here]
To access the MAMP mysql server.
I am trying to make mysql run on mac so I can make it work with rails 3. I installed the mysql*.dmg file from the official website, and I have also added this in my ".bashrc" file:
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
PATH=$PATH:/usr/local/mysql/bin
Now I have created a /tmp/mysql.lock file, changed its permission and I still get this error when I am trying to run mysql:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)
Any help installing mysql on Lion?
That's because MySQL is probably creating the socket file somewhere else. Use
mysqladmin variables
in the terminal to find out the exact location and use it in your database.yaml.
I have successfully installed MySQL using Homebrew. However, whenever I type the command mysql I receive this error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
I suspect this is a permission problem, as I have confirmed my system is looking for MySQL in the right location. However, I a novice with Unix(OSX) and don't know how to rectify the problem.
I am using OSX 10.7 (Lion)
which mysql produces /usr/local/bin/mysql
When you type 'mysql' you are running the MySQL client. The client needs to communicate with the server. If you simply run 'mysql' without any argument it assumes you are trying to connect to a mysql server that is located on 'localhost' using the user name as the user you are running the command as and without a password.
From the error it seems your server is not running yet. Start it by typing:
mysql.server start
I recently upgraded to a new macbook pro and haven't been able to get mysql to install. I have been trying to install using the:
mysql-5.5.8-osx10.6-x86_64.dmg
which 'should' work for my machine, but is not. After installing the three pieces (mysql.pkg,
startup.pkg, prefpane) I get nothing. Trying to start mySQL through the prefpane freezes sysprefs. Trying to start via the terminal gets this error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
So I deleted all of the mysql install files and reinstalled following these instructions:
https://discussions.apple.com/message/12820394
when I get to the step where I would set up the root password i get the following error:
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
This is perhaps due to the fact that there are no mysql related files in /tmp ? I can't find anything *.sock anywhere on my machine at all. I really don't know much about server admin, so I could be totally confused and off here.
It can have moved to /var/mysql/mysql.sock. I think it is the new position. You may need to point your php.ini to that or create a symbolic link to ln -s /var/mysql/mysql.sock /tmp/mysql.sock...