By yannbohbot
Hey guys, im new to mySQL and i’m trying to connect to the server. I set up a one-click install of mySQL and i’m trying to connect through my Macbook (Terminal) by putting the command found in the the “Flags” section. However, when executed i get this error message and i have no idea what it means or how to solve it. Can anybody help me with this?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @yannbohbot,
Can you please confirm the exact command you are trying to use to connect to your MySQL?
Additionally, please make sure, you’ve allowed traffic of your IP to the MySQL port. The Port MySQL usually uses is 3306. You can check that from your droplet.
Additionally, if you ssh to your droplet, can you enter MySQL from there?
To do so, do the following
ssh root@IpOfYourDroplet
Once you are in, type in
mysql
And see if you would be logged in.
If you aren’t, check if MySQL is running with the following commands
service mysql status
Or with
netstat -tulpen
Check if anything is running on port 3306 at all. If MySQL is actually running, you’ll need to allow your IP to access the specific port.
In most cases following simple rule opens TCP port 3306:
iptables -A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT
However I won’t recommend that, I’ll recommend just allowing your IP like
iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d XXX.XXX.XXX.XXX --dport 3306 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -s XXX.XXX.XXX.XXX --sport 3306 -d 0/0 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT
Please remember to change XXX.XXX.XXX.XXX with your actual IP address.
Regards, KDSys
I don’t think that you’ve done anything incorrectly, @yannbohbot. Have you successfully connected to this DB instance before?
The error you pasted above seems to be related to SSL
➜ ~ perror 60
...
MySQL error code MY-000060: SSL error: %s.
You might try downloading the CA cert from the control panel and addressing it in your command such as;
mysql -u doadmin -p**** -h tgrowdb-do-user-2929349-0.db.ondigitalocean.com -P 25060 -D defaultdb --ssl-cert={path to}/ca-certificate.crt --ssl-mode=REQUIRED
Also check the Logs/Queries tab in the control panel do you see anything in the bottom panel suggesting a problem?
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.