Open MySQL server for remote  access

Posted on 2014-08-08
Last Modified: 2014-08-12

I have a server running Windows Web Server 2007. On this I have IIS 7 and am running MySql.

This is running fine over localhost. However, I want to hook up remotely from my machine while developing to the server.

As its working over localhost, I assume i just need to open up port 3307 on the firewall. Now I'm worried about security with this? could anyone please advise the safest way to do this and if poss please provide some instructions so I can ensure that its protected?

Thanks in advance.

Question by:flynny
    LVL 32

    Expert Comment

    by:Daniel Wilson
    You probably need to adjust permissions as well, but for the firewall question ...

    Does your development machine (or rather its network) have a fixed public address?  If so, open a hole in the firewall for only that IP.

    Author Comment


    Yes and no. The work address has a fixed IP so I could fix it for that. However I was also hoping to work fro home but this doesnt have a fixed IP.

    Server side from windows firewall I just tried opening the 3306 port for now doing the following;

    1. New Rule.
    2. Select Port
    3. Select TCP specific port 3306
    4. Allow the connection
    5. Rule applies Domain/Private/Public all selected.
    6. Named the rule.

    I then loaded MySQL workbench locally to test the connection.

    Setup new connection -> Standard TCP/IP
    Server: IPaddress of server por 3306.
    user: root and password

    I am assuming it is connecting but I get the error;

    'Access denied for user'
    'root'@'' (Using password:YES)

    now I dont understand the @ '' as the domain doesnt relate to the server? can I set this?

    Author Comment

    ok I think I am getting somewhere.

    following this article;

    I can see localhost is the only value in the list of the hosts table. This is great and will be fine for my work location, as I can add the IP. How can I fix this issue for the public ip issue working from home?
    LVL 32

    Expert Comment

    by:Daniel Wilson

    This way of doing it creates a user@specified_IP with access.  I would consider adding

    with the same password.

    Author Comment

    Ok thanks.

    Any ideas on how i can handle the home issue with no static ip??

    I assume as long as I don't renew the connection I can just added the current ip?
    LVL 32

    Accepted Solution

    Consider using a dynamic DNS provider.

    create user 'home_user'@'' identified by 'my_cool_password';
    LVL 32

    Expert Comment

    by:Daniel Wilson
    Using a domain name does suggest a slower connection b/c DNS lookups will be involved.  But for development rather than production, I doubt it will matter.

    Author Closing Comment

    brilliant thank you for your help

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (…
    Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL ( several years ago, it seemed like now was a good time to updat…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    779 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

    18 Experts available now in Live!

    Get 1:1 Help Now