Connect to remote mysql server from webserver

Posted on 2012-09-04
Medium Priority
Last Modified: 2012-09-04
I have a mysql server and a webserver, both are on the same subnet.

I set up mysql to allow remote connections.  I am able to connect to it from the webserver on the command line using:

mysql -u snort -p -h

No problems.  But when I use the same information in the "base" utitlity for snort I get:

Database ERROR:Host '' is not allowed to connect to this MySQL server

Any ideas?
Question by:savone
LVL 10

Accepted Solution

stu215 earned 2000 total points
ID: 38365905
If your on a linux machine SELinux may be causing a problem with it...

Try setting it to permissive mode and then run it in your program:
( Run the following on the command line )
setenforce 0

To put it back:
setenforce 1

You might also try temporarily turning off the firewall running your command & then putting it back up to see if a port needed is blocked. ( You can narrow the port down after if this works )

I believe the default port is: 3306

You might also check the permissions on the user you are trying to connect to MySQL to see if it is allowed to remotely connect.

See Step 5 in the guide:

The following shows how to get what permissions a user currently has:
LVL 23

Author Closing Comment

ID: 38365992
It was selinux on the webserver... Thanks!

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

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month13 days, 23 hours left to enroll

807 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