Unable to connect to mysql using public IP - 10061

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Unable to connect to mysql using public IP - 10061

Post by raghavan20 »

I tried to install mysql 5.0.20 but it did not mysql.user table eventhough i saw frm files are available.

I uninstalled it and installed 5.0.18, but still it does not have mysql.user table and for your information, the mysql database do not have any table/s at all.

EDIT: question 2: I have a public ip: 82.x.x.x. I want to allow users to access my database through global ip. I have allowed ports 3306-3307 on my router. I am not able to create new user @'%' as of now because of mysql.user table missing but still it reports the following...

Code: Select all

D:\Program Files\MySQL\MySQL Server 5.0\data\mysql>mysql -u root -h 82.x.x.x
ERROR 2003 (HY000): Can't connect to MySQL server on '82.x.x.x' (10060)
Last edited by raghavan20 on Sat Apr 29, 2006 5:59 pm, edited 4 times in total.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

The basic commands that you must execute to install and use a MySQL binary distribution are:

shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
shell> chgrp -R mysql .
shell> bin/mysqld_safe --user=mysql &
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

Thanks for your answers.

I am trying to install mysql 5.0.20a in Windows XP. I have tried to install it two times, but it does not have mysql.user table

this is the file list under data/mysql directory....you can still see user table related files but they do not work.
Directory of D:\Program Files\MySQL\MySQL Server 5.0\data\mysql

29/04/2006 21:31 <DIR> .
29/04/2006 21:31 <DIR> ..
18/04/2006 13:57 8,820 columns_priv.frm
18/04/2006 13:57 0 columns_priv.MYD
18/04/2006 13:57 1,024 columns_priv.MYI
18/04/2006 13:57 9,494 db.frm
18/04/2006 13:57 876 db.MYD
18/04/2006 13:57 4,096 db.MYI
18/04/2006 13:57 8,665 func.frm
18/04/2006 13:57 0 func.MYD
18/04/2006 13:57 1,024 func.MYI
18/04/2006 13:57 8,700 help_category.frm
18/04/2006 13:57 20,916 help_category.MYD
18/04/2006 13:57 3,072 help_category.MYI
18/04/2006 13:57 8,612 help_keyword.frm
18/04/2006 13:57 74,466 help_keyword.MYD
18/04/2006 13:57 15,360 help_keyword.MYI
18/04/2006 13:57 8,630 help_relation.frm
18/04/2006 13:57 6,534 help_relation.MYD
18/04/2006 13:57 12,288 help_relation.MYI
18/04/2006 13:57 8,770 help_topic.frm
18/04/2006 13:57 248,100 help_topic.MYD
18/04/2006 13:57 16,384 help_topic.MYI
18/04/2006 13:57 9,416 host.frm
18/04/2006 13:57 0 host.MYD
18/04/2006 13:57 1,024 host.MYI
18/04/2006 13:57 9,691 proc.frm
18/04/2006 13:57 0 proc.MYD
18/04/2006 13:57 1,024 proc.MYI
18/04/2006 13:57 8,875 procs_priv.frm
18/04/2006 13:57 0 procs_priv.MYD
18/04/2006 13:57 1,024 procs_priv.MYI
18/04/2006 13:57 8,947 tables_priv.frm
18/04/2006 13:57 0 tables_priv.MYD
18/04/2006 13:57 1,024 tables_priv.MYI
18/04/2006 13:57 8,636 time_zone.frm
18/04/2006 13:57 0 time_zone.MYD
18/04/2006 13:57 1,024 time_zone.MYI
18/04/2006 13:57 8,624 time_zone_leap_second.frm
18/04/2006 13:57 0 time_zone_leap_second.MYD
18/04/2006 13:57 1,024 time_zone_leap_second.MYI
18/04/2006 13:57 8,606 time_zone_name.frm
18/04/2006 13:57 0 time_zone_name.MYD
18/04/2006 13:57 1,024 time_zone_name.MYI
18/04/2006 13:57 8,686 time_zone_transition.frm
18/04/2006 13:57 0 time_zone_transition.MYD
18/04/2006 13:57 1,024 time_zone_transition.MYI
18/04/2006 13:57 8,748 time_zone_transition_type.frm
18/04/2006 13:57 0 time_zone_transition_type.MYD
18/04/2006 13:57 1,024 time_zone_transition_type.MYI
18/04/2006 13:57 10,330 user.frm
18/04/2006 13:57 48 user.MYD
18/04/2006 13:57 2,048 user.MYI
51 File(s) 567,702 bytes
2 Dir(s) 3,251,163,136 bytes free
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

I have by mistake blocked 3306-3307 ports in the router so I do not get the error 10060.

I managed to dump the sql for mysql database from other mysql server and created user tables and I have added a new user @ %

but still when I access through public IP it does not work but it works when I access it from localhost

Code: Select all

D:\Program Files\MySQL\MySQL Server 5.0\data\mysql>mysql -u remoteadmin -h 82.x.x.x-p
Enter password: *******
ERROR 2003 (HY000): Can't connect to MySQL server on '82.x.x.x' (10061)

D:\Program Files\MySQL\MySQL Server 5.0\data\mysql>mysql -u remoteadmin  -p
Enter password: *******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 23 to server version: 5.0.18

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
Last edited by raghavan20 on Sat Apr 29, 2006 4:16 pm, edited 1 time in total.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Did you install a package named something like this? mysql-5.0.20a-win32.zip with an MSI installer? You should just be able to intall it and run it.
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

you are right...I installed using windows i nstaller and configured it,,,but when I tried to put the root password in, the mysql reported that mysql.user table is missing....I do not know whether the package was build properly.

If possible, you can try installing on your system and tell me whether the problem was when installing on my system or was it a permanent problem with the build.

I appreciate for your continued interest in the topic.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

mysql-5.0.20a-win32.zip package installed just fine.

I installed it using the typical settings and used the config wizard to set the root password. I installed it as a service.
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

thanks for doing that for me atleast that clears the fact that there is some problem with my installation.

I have been trying to telnet the port 3306 for db connection from public IP...it does not work

Code: Select all

D:\Program Files\MySQL\MySQL Server 5.0\data\mysql>telnet 82.46.70.227 3306
Connecting To 82.46.70.227...Could not open connection to the host, on port 3306: Connect failed
but for local ip:

It basically connects and gets the version information and then exits. I do not know at the first point how to provide username and password when connected through telnet.

Code: Select all

telnet 192.168.0.101 3306


4
 5.0.18R^$6"H$vI,ó0&#9787;Jv6F@NGWacK,

Connection to host lost.

D:\Program Files\MySQL\MySQL Server 5.0\data\mysql>

My virtual server settings in the router are (look at enabled entries),

Code: Select all

enabled	 Virtual Server FTP 192.168.0.101 TCP 21/21 always  
enabled    Virtual Server HTTP 192.168.0.101 TCP 8080/80 always  
	 Virtual Server HTTPS 0.0.0.0 TCP 443/443 always  
	 Virtual Server DNS 0.0.0.0 UDP 53/53 always  
	 Virtual Server SMTP 0.0.0.0 TCP 25/25 always  
	 Virtual Server POP3 0.0.0.0 TCP 110/110 always  
	 Virtual Server Telnet 0.0.0.0 TCP 23/23 always  
	 IPSec 0.0.0.0 UDP 500/500 always  
	 PPTP 0.0.0.0 TCP 1723/1723 always  
	 NetMeeting 0.0.0.0 TCP 1720/1720 always  
	 DCS-1000 0.0.0.0 TCP 80/80 always  
	 DCS-2000/DCS-5300 0.0.0.0 TCP 800/800 always  
	 i2eye 0.0.0.0 TCP 1720/1720 always  
	 DCS-3120 0.0.0.0 UDP 3120/3120 always  
enabled    db access 192.168.0.101 TCP 3306/3306 always
resultant firewall rules compiled by D-link

Code: Select all

Allow db access *,* *,* TCP,3306-3307  
 Deny  LAN,192.168.0.102 WAN,* TCP,80  
 Allow Allow to Ping WAN port WAN,* WAN ICMP,8  
 Allow Virtual Server HTTP WAN,* LAN,192.168.0.101 TCP,8080-80  
 Allow Virtual Server FTP WAN,* LAN,192.168.0.101 TCP,21  
 Allow db access WAN,* LAN,192.168.0.101 *,3306  
 Deny Default *,* LAN,* *,*  
 Allow Default LAN,* *,* *,*
I strongly suspect this to be a problem with the router setting, D-link. If anybody has got D-link and made DB access work with public IP, please let me know how you did it.
Post Reply