PDA

View Full Version : SQLYog Connection to Database



LarsJohann
20-06-2009, 12:24 PM
Hello everybody, I am trying to set up an SQL database on my computer and am using the client called SQLYog and i am wondering ,how can I set up a database to have others connect to it instead of using Localhost? I run my connection through DynDNS.What are the steps to get others to be able to connect to my database?


Thanks alot,

Simon.

somebody
20-06-2009, 12:32 PM
What sort of SQL database is this? MS SQL Server (if so, is it 2005 or 2008)?

LarsJohann
20-06-2009, 12:49 PM
I am running MySQL 5.1.

Erayd
20-06-2009, 01:09 PM
I am running MySQL 5.1.
Comment out the 'bind 127.0.0.1' line from the config file, and restart MySQL - it will then bind to all addresses by default. This will make it publicly accessible.

somebody
20-06-2009, 01:17 PM
Comment out the 'bind 127.0.0.1' line from the config file, and restart MySQL - it will then bind to all addresses by default. This will make it publicly accessible.

After that, you will need to forward port 3306 on your router through to your computer. Then anyone on the internet should be able to connect to your database by using your DynDNS address.

LarsJohann
20-06-2009, 02:40 PM
Hello everyone thanks for the help, but i still cannot connect to my DYNS address. I get some error :s

Erayd
20-06-2009, 04:05 PM
Hello everyone thanks for the help, but i still cannot connect to my DYNS address. I get some error :s
Any chance you could let us know what "some error" says?

LarsJohann
20-06-2009, 04:43 PM
It gives me the error code "Error 1130".

LarsJohann
20-06-2009, 05:24 PM
Alright, for example purposes, the DynDNS Host is mysql.ath.cx
MySQL Info:
Username: Root
Password: Root

Now what I'm trying to accomplish here, is to have my developers be able to connect to the database by using the hostname mysql.ath.cx with the username of root and password of root. I have gone to the host file in windows/system32/drivers/etc and deleted the 127.0.0.1 localhost line so that it reads 11.111.111.11 mysql.ath.cx. But when i try logging in I get this error:

Error 1130 (http://i691.photobucket.com/albums/vv279/Totergott/SQLyogErrorExample.jpg)
In that picture, i edited my info to go with the example.
UPDATE: I apologize, the image is super small for some reason >.< You'll have save it and zoom in. Sorry about that.

Now this is what my host file reads:


# Copyright (c) 1993-2006 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
11.111.111.11 mysql.ath.cx
::1 localhost



Is there something I'm not typing right?


Thank you for your time and appreciate all the help I can get.

somebody
20-06-2009, 05:27 PM
I can't vouch for the validity of this, but you can try: http://lists.mysql.com/mysql/144730

Erayd
20-06-2009, 05:36 PM
First off, put your hosts file back how it was before - changing it will not help, and removing the localhost entry will break things. When I said to remove the line reading 'bind 127.0.0.1' I was talking about the MySQL config file (usually my.cnf), not the hosts file.

To solve error 1130 you'll need to grant the correct permissions to your users - somebody's post above explains how to do that.

LarsJohann
21-06-2009, 06:56 AM
# Copyright (c) 1993-2006 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost # This was the line I removed
11.111.111.11 mysql.ath.cx # Me
22.222.22.22 mysq.ath.cx # My Dev <- I just added him in
::1 localhost



Alright, so that's what it used to look like before I removed 127.0.0.1.
My Dev gets the error 1130 when trying to connect, so there must be something I'm not doing to unblock him. If I make any changes to host file, should I restart the MYSQL Window Service? or restart the computer?

:thanks

Erayd
21-06-2009, 03:35 PM
You don't (usually) need to reboot after changing the hosts file, but it doesn't hurt.

As has been mentioned above, this isn't a firewall issue - it's a permissions issue. You need to grant your developer access from hosts other than localhost. You can do this via the GRANT command, or if you'd prefer most GUIs have the ability to set privileges.