homepage Welcome to WebmasterWorld Guest from 54.226.213.228
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

    
MySQL database access
Access the another system mysql database in my system
data




msg:4480087
 12:29 pm on Jul 30, 2012 (gmt 0)

How to access the another system mysql database through MySQL Administrator.what are the changes are need to connect the another system mysql database?

 

brotherhood of LAN




msg:4480113
 1:38 pm on Jul 30, 2012 (gmt 0)

Welcome to the forums data,

3 things mainly.

1) you change the hostname that you are connecting to. usually you connect to 'localhost', but to connect to remote machines you must put the server name instead

2) mysql has to be configured to allow access from any non-localhost users.

3) the user you are connecting with has to be allowed to connect from a non-localhost machine.

Is the database on a computer you own, dedicated server or shared server? If a shared server, it's hit and miss as to whether you are allowed non-localhost connections.

data




msg:4480422
 4:34 am on Jul 31, 2012 (gmt 0)

Hi,
Thanks for your above information.
1)Can you tel me where can i change the server name instead of localhost.
2)How to configure the mysql to allow access from any non localhost.Is it to be done on installation?

brotherhood of LAN




msg:4480423
 4:45 am on Jul 31, 2012 (gmt 0)

You're welcome.

> 1)Can you tel me where can i change the server name instead of localhost.

From the command line
mysql -h localhost -u root -p databasename --password=root


Where -h stands for host.

> 2)How to configure the mysql to allow access from any non localhost.Is it to be done on installation?

This pretty much covers it: [debianhelp.co.uk...]

As I said earlier, it depends on the setup. On shared hosts you may not be able to edit the MySQL settings. On the other hand you may be able to connect from a remote IP with its current setup.

data




msg:4480424
 4:57 am on Jul 31, 2012 (gmt 0)

Hi,
I have tried this command
mysql -h localhost -u root -p databasename --password=root

But getting error like below :(

C:\Bugzilla\mysql\bin>mysql -h <system ip> -u root -p mysql --password=root
ERROR 2003 (HY000): Can't connect to MySQL server on '<system ip>' (10061)

brotherhood of LAN




msg:4480426
 5:04 am on Jul 31, 2012 (gmt 0)

Is the remote server a server you own, is it on a shared host?

That info would help as the answer can depend on how much you are able to edit or view the config of mysql on the remote server.

It could be that mysql is on a non-standard port (it's usually 3306 and that's the port your mysql command would have tried to connect to)... or it may be the wrong IP.

data




msg:4480427
 5:08 am on Jul 31, 2012 (gmt 0)

Is the remote server a server you own, is it on a shared host?

Can you explain it more?

And am trying above command in my system. System ip is corect oly. And my DB port is 3305. Because am using two Mysql in my system.

brotherhood of LAN




msg:4480430
 5:14 am on Jul 31, 2012 (gmt 0)

Try

mysql -h the.ip.address --port 3305 -u username -p databasename --password=password

data




msg:4480433
 5:28 am on Jul 31, 2012 (gmt 0)

Sorry its showing the same error
ERROR 2003 (HY000): Can't connect to MySQL server on '<system ip>' (10061)

But i have tried in other machine mysql -h <my system ip> -u username -p databasename --password=password.

Its executed.But am not able to access the database from my machine.

brotherhood of LAN




msg:4480438
 5:33 am on Jul 31, 2012 (gmt 0)

I'm going to guess that it's due to the MySQL config. There is a file called my.cnf with some MySQL variables in it as part of your installation, find the following line

bind-address= 127.0.0.1

The IP address may be different. Change the IP to the IP of the machine with MySQL on it, then restart MySQL, that may sort it.

data




msg:4480446
 5:59 am on Jul 31, 2012 (gmt 0)

Sorry to say this.i dont have any file like my.conf in my mysql bin folder. But in mysql folder am having my-huge,my-large,my-medium,my-small conf:(
Am having my.conf in mysql installed on port 3306. not in 3305 pot mysql :(

data




msg:4480447
 6:15 am on Jul 31, 2012 (gmt 0)

I have got one file like my spped dial shortcut. in that bid address i have changed it to my system ip. but now am getting eror like

C:\Bugzilla\mysql\bin>mysql -h <syste ip>--port 3305 -u root -p mysql --password=root
ERROR 1130 (HY000): Host 'computer name' is not allowed to connect to
this MySQL server


what to do :(

data




msg:4480449
 6:22 am on Jul 31, 2012 (gmt 0)

i got confused. If i am doing this command


mysql -h the.ip.address --port 3305 -u username -p databasename --password=password

is it possible to access my database from any other machines?

brotherhood of LAN




msg:4480639
 6:08 pm on Jul 31, 2012 (gmt 0)

Sounds like you made progress....

3) the user you are connecting with has to be allowed to connect from a non-localhost machine.


That's the issue IMO. You need to look at GRANT PRIVILEGES for the user you are connecting with to allow them to connect from other IPs... a quick google will give you the relevant mysql manual page about granting privileges.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved