LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-13-2011, 02:20 AM   #1
uppalagayatri
LQ Newbie
 
Registered: Mar 2011
Posts: 26

Rep: Reputation: 1
access remote mysql db with mysql-administrator command


Hi

I have install mysql on my fedora12. My different mysql server is located in us. I want to check health status and hits per seconds everything. Is it possible with mysql-administrator command.


now a these days i am connect through ssh and excuting below command
#mytop mysql -u root -p <passwd>


In my mysql db i have added the userip & passwd (allowed the privileages for that ip)

If i use mysql-administrator
i am getting below error

##########
MySQL Error Nr. 2003
Can't connect to MySQL server on '66.98.152.64' (111)
###########

please guide how to fix the problem


Thanks in advanced...............
 
Old 05-13-2011, 02:35 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

First thing you'd need to check is if MySQL server is configured to accept connections from the outside world and not only from localhost. Next I'd check any firewalls (iptables, hardware, ...) and routers (to see if ports are being directed correctly) between your computer and the remote server to see if they allow connections on port 3306, which is the default port for MySQL. If all that checks out correctly, then review the user settings in MySQL.

Kind regards,

Eric
 
Old 05-13-2011, 02:53 AM   #3
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,138
Blog Entries: 4

Rep: Reputation: 147Reputation: 147
Hi,

On 66.98.152.64 mysql server(if its a mysql server) :

vim /etc/my.cnf

Code:
[mysqld]
bind-address = 66.98.152.64
Grant access to a new database

If you want to add a new database called mydb for user db and remote IP 202.56.240.50 then you need to type the following
commands
mysql> prompt:

Code:
mysql> CREATE DATABASE mydb;
mysql> GRANT ALL ON mydb.* TO db@'202.56.240.50' IDENTIFIED BY 'urpassword';
Restart the mysql server, enter:

Code:
# /etc/init.d/mysql restart
Now you can connect using :
Code:
mysql -u db –h  66.98.152.64 –p
You can Monitor number of active connections to MySQL using Nagios using this link:

Last edited by prayag_pjs; 05-13-2011 at 02:58 AM.
 
Old 05-13-2011, 03:13 AM   #4
uppalagayatri
LQ Newbie
 
Registered: Mar 2011
Posts: 26

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by EricTRA View Post
Hello,

First thing you'd need to check is if MySQL server is configured to accept connections from the outside world and not only from localhost. Next I'd check any firewalls (iptables, hardware, ...) and routers (to see if ports are being directed correctly) between your computer and the remote server to see if they allow connections on port 3306, which is the default port for MySQL. If all that checks out correctly, then review the user settings in MySQL.

Kind regards,

Eric

Thanks for giving reply but i mention in my my.cnf file
bind-address=0.0.0.0

in iptables also it is accepting 3306(my default mysqlport) port number.
#iptables -A INPUT -p tcp -s <MY IP> --dport 3306 -j ACCEPT
In my remote system

Last edited by uppalagayatri; 05-13-2011 at 08:13 AM.
 
Old 05-13-2011, 03:22 AM   #5
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

You've posted iptables rule for SSH not for MySQL, check if it's there. Also did you check your router(s) for port redirection and physical firewalls if any are used?

Kind regards,

Eric
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Error Code 1064 - MySQL Administrator a_m0d Linux - Server 6 02-27-2009 05:02 AM
can access to mysql from remote,help!!! ajaxer Debian 2 06-30-2008 04:52 AM
MySQL 4.1 remote access james.reid Linux - Software 0 01-03-2006 06:55 AM
Restoring MySQL backups with mysql-administrator pnellesen Programming 0 04-25-2005 10:53 AM
How access MySQL by MySQL Administrator? treotan Linux - Newbie 5 12-04-2004 11:17 PM


All times are GMT -5. The time now is 09:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration