Solved

Remote connection to MySQL on Centos

Posted on 2011-02-11
7
1,162 Views
Last Modified: 2012-05-11
Hi,

trying to access a mysql database on a local network but having issues connecting. Also tried to telnet to it and getting "fhost 192...... is not allowed to connect to this mysql server. Below is iptables current setup so it should be working?

target     prot opt source               destination
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:mysql
0
Comment
Question by:andybrooke
  • 4
  • 2
7 Comments
 
LVL 7

Accepted Solution

by:
tlovie earned 500 total points
ID: 34872877
I think you have to add that host to the mysql permissions.  

mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%' WITH GRANT OPTION;
0
 

Author Comment

by:andybrooke
ID: 34873266
excellent I can now telnet. Tried to access mysql and now I get Access denied for Superuser@192...... Somthing simple I'm missing now....
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34873275
Yes, @tlovie is right, you have to have a MySQL user who is allowed to connect remotely AND who has privileges on the database you're trying to use.  MySQL does not provide 'generic' connections.
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 34873296
Telnet doesn't work with MySQL either.  It requires a MySQL client program which is a driver used by PHP and ASP and other programs.
0
 

Author Comment

by:andybrooke
ID: 34873332
I was only using telnet to test the connection. Both your posts have been irrelevant as we have already established I can now telnet remotley.

But now I'm unable to access mysql....
0
 

Author Comment

by:andybrooke
ID: 34875785
Can anybody please help.  I can now telent so the connection is active but it wont let me remote into mysql....
0
 

Author Comment

by:andybrooke
ID: 34876034
resolved, needed grant permissions for user..
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question