This document describes how to connect to a server running on the same computer as Sequel Ace. Table of ContentsConnect to a Local MySQL Server
Making sure your MySQL server is running
If you are not sure if the MySQL server is running, open Activity Viewer (from Applications » Utilities). Choose All Processes in the popup menu. Type mysqld into the search field. If you see a mysqld process, MySQL is running.
Connecting via a socket connection
Unfortunately, due to sandboxing nature, Sequel Ace is not allowed to connect to the sockets which are out of the sandbox. As a workaround, you can create a socket in ~/Library/Containers/com.sequel-ace.sequel-ace/Data and connect to it. This can be done by putting these lines to your MySQL configuration file (usually, my.cnf):
[mysqld] socket=/Users/YourUserName/Library/Containers/com.sequel-ace.sequel-ace/Data/mysql.sockConnecting via a standard connection
Open Sequel Ace. Choose a Standard Connection. Enter 127.0.0.1 for the host. The default username for a new MySQL installation is root, with a blank password. You can leave the port field blank unless your server uses a different port than 3306.
Note: MAMP uses port 8889 per default, and root as the password. See Connecting to MAMP or XAMPP
Note: Don’t try using localhost instead of 127.0.0.1. MySQL treats the hostname localhost specially. For details, see MySQL manual.
Navigation
- Home
- Search
- Privacy Policy
Discover
- Terms And Conditions
- Cookie Agreement
- Contacts
Contact Us
- About Us
- Disclaimer
Macguided
Macguided is a website that writes about many topics of interest to you, a blog that shares knowledge and insights useful to everyone in many fields.
© 2022 Macguided. All Rights Reserved.
A have already read everything about this error but I coundn't solve the problem.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)I'm trying to install mysql on my Mac OsX but when I try to connect to the db (mysql -u root -p) I see this problem, ERROR 2002.
I have Mysql installed in /usr/local/mysql
asked Dec 19, 2012 at 12:43
4
Check the MySQL daemon is running
You can check if the mysqld daemon from **Terminal Application* running:
ps -feax | grep mysqldAnd verifying that you get something similar to this:
0 8308 1 0 0:00.08 ?? 0:00.11 /bin/sh /usr/local/mysql/bin/mysqld_safeor looking for a mysqld process on the Activity Monitor application
If it's not running you have to start the daemon.
Start MySQL daemon
On Mac OSX you can start the daemon from the Terminal Application with something like this:
sudo /usr/local/mysql/bin/mysqld_safe &Again check that now the MySQL daemon is running as described before.
answered Dec 19, 2012 at 13:40
pconcepcionpconcepcion
3346 silver badges16 bronze badges
6
You say you get the error when you run mysql -u root -p
This will look for a socket file to connect. When mysqld started up, it is possible for the socket file not to be made and still have mysqld start up ( See my post Percona-server time out on /etc/init.d/mysql start )
Try using one of the following to see if you can connect without a socket file
- mysql -u root -p -h227.0.0.1
- mysql -u root -p -h227.0.0.1 --protocol=tcp
If you can connect with one of these, the shutdown mysql like this
mysqladmin -u root -p -h227.0.0.1 --protocol=tcp shutdownmysqld should shutdown properly. Afterwards, startup mysql as usual
Give it a Try !!!
answered Dec 19, 2012 at 17:25
RolandoMySQLDBARolandoMySQLDBA
16.4k3 gold badges47 silver badges80 bronze badges
2
I know this is an older post, but I spent the last hour or so bouncing back and forth between serverfault, StackOverflow, and DataBase administrators trying to figure out how to solve this issue after installing on Mac (El Capitan) using homebrew.
At least in my case, the advice from this post worked:
# Run the following commands mysqld stop mysql.server startFrom what I can gather, I think (at least in my case) brew mysql hadn't initialized the permanent socket and my network admin locked down the ability to connect new processes via /tmp/...
answered Jan 20, 2017 at 16:13
I am using MacOX El Capitan 10.11.3 and I faced the above issue and none of the answers worked independently. I then tried a combination of user153254 and Adam's and it worked like a charm!
mysqld stop mysql.server start mysql -u rootAvoiding mysql -u root -p did the trick
answered Mar 21, 2017 at 8:53
ArnavArnav
111 bronze badge
I had the exact same problem and I searched every possible site for solution to such problem and was not be able to solve it. However, today I did a simple command line from the Mac's Terminal that is I just typed in mysql -u root and then it solved the problem for me.
Let me know if this solution helps.
answered Jan 13, 2013 at 20:35
Provide hostname along with username and password
mysql -u <username> -p<password> -h <yourhostname>answered Dec 12, 2018 at 8:21
main reason is mariadb/mysql is not running.
brew services start mariadbOR
brew services start mysqlI solved same issue in MariaDB with bellow command. restart MariaDB/MySQL
I have installed MariaDB though homebrew. i have also restart my computer before running command.
answered Mar 17, 2019 at 7:15
Nanhe KumarNanhe Kumar
4094 silver badges6 bronze badges
2
Can't connect to local MySQL server Mac?
You'll need to start MySQL before you can use the mysql command on your terminal. To do this, run brew services start mysql ..
Go to "System Preference".
At the bottom pane there should be MySql icon..
Double click that to launch the 'MySQL Server Status' and press the button 'Start MySQL Server'.
How do I connect to a local MySQL database Mac?
You can run the command /usr/local/mysql/bin/mysql -u root -p to connect to the MySQL database server as below. After you input the correct password ( the root password which you set during the MySQL installation ), you can enter the MySQL interactive console.
Can not connect to local MySQL server?
normally means that there is no MySQL server running on the system or that you are using an incorrect Unix socket file name or TCP/IP port number when trying to connect to the server. You should also check that the TCP/IP port you are using has not been blocked by a firewall or port blocking service.
How do I connect to MySQL locally?
To Connect to a MySQL Database.
Click Services tab..
Expand the Drivers node from the Database Explorer. ... .
Enter User Name and Password. ... .
Click OK to accept the credentials. ... .
Click OK to accept the default schema..
Right-click the MySQL Database URL in the Services window (Ctrl-5)..