开发者

Not able to connect to the mysql server at fdb3.atspace.com

My website is hosted by http://atspace.com and these are the details for my database:

host: fdb3.atspace.com
user: xxxxxx
pass: yyyyyy
data开发者_运维百科base name: nnnnnn

So basically I've just installed mysql command line client on my computer (windows vista) and I tried running:

mysql -uxxxxxx -pyyyyyy -hfdb3.atspace.com nnnnnn

but I'm always getting the error:

ERROR 2003 (HY000): Can't connect to MySQL server on 'fdb3.atspace.com' (10061)

Basically my question is how do we connect to a remote mysql server from a computer?


You need to configure mysql to do so. Usually mysql is bound on 127.0.0.1 to be only available via localhost connections.

You need also to grant rights to the user.

If you have SSH to your space and it is bound to 127.0.0.1 you may connect via SSH tunnel.

ssh -L 3306:localhost:3306 user@atspace.com

Than you will be able to connect to your remote mysqld using localhost:3306


Its usually very bad practice to expose a DBMS directly on the internet - unless you purchased a database-only hosting package from the service provider, it's very likely that you won't get external access - the machine should be on non-routable address or firewalled.

How you go about getting access to your database depends on what is available within the package you are paying for. One obvious solution would be to install phpmyadmin on your webserver , or ssh into your webserver and try to run the mysql client from there.

There may be further options available if these boxes are virtual/dedicated (i.e. you've got root access and can install your own binaries)


1.edit your my.cnf and disable

bind-address 127.0.0.1

2.allow someone access your db server from remote server use this:

grant all on . to 'username'@'ipaddress' identified by 'password'

the ipaddress can be %, 192.168.1.% etc...


If you're connecting from remote machine you need to set up database server to accept remote connections.

How to do so? By visiting this link, you'll learn how to configure your server correctly.

You may find usefull informations in @Neo's answer however if you want to learn new thing, I'd suggest visiting the link I provided.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜