How to connect to MySql in another Ubuntu machine?
Hi How do i connect to MySql from another Ubuntu machine. I tried this
mysql -h 'IP' -P 3306 -u test -ptest
I get ERROR 2003 (HY000): Can’t connect to MySQL server on ‘IP’ (111). then i tried
nmap -sS -O -p 3306 'IP' and it says 3306/tcp closed mysql
But in the MySql machine when i try it with localhost it works
nmap -sS -O -p 3306 localhost it says 3306/tcp open mysql
What am i missing here
Two ways to check this:
[1] in /etc/mysql/my.cnf if the database is configured to be listening on localhost (127.0.0.1) only.
Look for the line
bind-address = 127.0.0.1
and comment this line, follow by a restart of the database.
I think this is your issue, since this is default in Ubuntu.
[2] Run “netstat -an | grep 3306″ – it should give this when open for connections from the outside:
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
Check more discussion of this question.
Related posts:
Leave a comment
Recent Posts
- Cron expression that runs every 5 minutes from 1:30 am – 6:00 am [duplicate]
- Understanding redundant power supplies
- Is there a way for administrators to disable users from installing Firefox extensions?
- Is there research material on NTP accuracy available?
- How to create a limited “domain admin” that does not have access to domain controllers?
Tags
active-directory
amazon-ec2
apache
apache2
backup
bash
centos
cisco
command-line
debian
dns
email
exchange
firewall
iis
iis7
iptables
linux
macosx
monitoring
mysql
networking
nginx
performance
permissions
php
postfix
raid
security
sql-server
sql-server-2005
sql-server-2008
ssh
ssl
ubuntu
unix
virtualization
vpn
webserver
windows
windows-7
windows-server-2003
windows-server-2008
windows-server-2008-r2
windows-xp





