Connect to remote mysql server from webserver

Posted on 2012-09-04
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

    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

    It was selinux on the webserver... Thanks!

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Suggested Solutions

    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now