Enable remote MySQL access (root non-local access)

Often one of the first tasks after setting up a MySQL server is to enable connections from other IP addresses. Here are a some articles that discuss how to setup a user that can access a MySQL database remotely (non-locally). Between the two of them you will have all the info you need to create user accounts for remote MySQL db access 🙂

If you are in a testing environment you can also enable non-local root access for all databases from all addresses. However, for a production environment you will likely want specific users for specific DBs and limit the IPs (either specifically or by range).

Enable remote MySQL connection – Stack Overflowhttp://stackoverflow.com/questions/8380797/enable-remote-mysql-connectionGRANT ALL PRIVILEGES ON *.* TO ‘USERNAME’@’IP’ IDENTIFIED BY ‘PASSWORD’; where IP is the IP you want to allow acess and USERNAME is the user you use to connect
How Do I Enable Remote Access To MySQL Database Server? – nixCrafthttp://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.htmlBy default remote access to the MySQL database server is disabled for security reasons. However, some time you need to provide remote access to database server from home or a web server. This post…

Example MySQL statement to grant all privileges (except GRANT OPTION) to root:

GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ IDENTIFIED BY ‘somepassword’;

Grant all including grant option:

GRANT ALL ON *.* TO  ‘root’@’%’  IDENTIFIED  BY  ‘somepassword’;

And a more fine-grained example from the previous links in this article:

GRANT ALL ON foo.* TO bar@’202.54.10.20′ IDENTIFIED BY ‘PASSWORD’;

🙂

[END]

Leave a Reply

Your email address will not be published. Required fields are marked *