Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not connect using mysql client #1470

Closed
hbinduni opened this issue Mar 23, 2021 · 4 comments
Closed

Can not connect using mysql client #1470

hbinduni opened this issue Mar 23, 2021 · 4 comments

Comments

@hbinduni
Copy link

Hi, i try to connect using mysql client and get this error message:

❯ mysql -uroot -p projects_dolt
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

this is mysql version i used:

❯ mysql --version
mysql  Ver 8.0.23 for osx10.16 on x86_64 (Homebrew)
❯ dolt version
dolt version 0.24.2
@VinaiRachakonda
Copy link
Contributor

@hbinduni Can you let me know what port you are starting your sql-server on? Here's how I typically do it

dolt sql-server --port=3307 on the server side

mysql --host=127.0.0.1 --port=3307 --user=root -p on the client side

@zachmu
Copy link
Member

zachmu commented Mar 23, 2021

Hi @hbinduni,

The MySQL shell on Linux and Mac is going to try to connect to localhost with a socket file unless you tell it not to. We only support TCP connections. Try this:

mysql --host 127.0.0.1

I also updated the FAQ for you:

https://github.com/dolthub/dolt/blob/master/docs/faq.md#the-mysql-shell-gives-me-an-error-cant-connect-to-local-mysql-server-through-socket-tmpmysqlsock-2

@hbinduni
Copy link
Author

thank you for your help. after applying host in mysql, i can connect very well.

❯ dolt sql-server
Starting server with Config HP="localhost:3306"|U="root"|P=""|T="28800000"|R="false"|L="info"

❯ mysql -uroot -p projects_dolt -h 127.0.0.1
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.9-Vitess

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

@VinaiRachakonda
Copy link
Contributor

Glad to hear that @hbinduni. i'm closing this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants