Search the MySQL manual:

4.2.1 General Security Guidelines

Anyone using MySQL on a computer connected to the Internet should read this section to avoid the most common security mistakes.

In discussing security, we emphasise the necessity of fully protecting the entire server host (not simply the MySQL server) against all types of applicable attacks: eavesdropping, altering, playback, and denial of service. We do not cover all aspects of availability and fault tolerance here.

MySQL uses security based on Access Control Lists (ACLs) for all connections, queries, and other operations that a user may attempt to perform. There is also some support for SSL-encrypted connections between MySQL clients and servers. Many of the concepts discussed here are not specific to MySQL at all; the same general ideas apply to almost all applications.

When running MySQL, follow these guidelines whenever possible:

User Comments

Posted by George Toft on Wednesday January 22 2003, @4:54am[Delete] [Edit]

Placing a database server in a DMZ is *NOT* a good security practice. Databases should be inside the company, which means there are at least two firewalls (three if using an application server in a three-tier architecture) between the Internet and the database server.

Posted by Ben Powell on Wednesday February 26 2003, @5:53am[Delete] [Edit]

Searchdatabase.com author criticises mySQL security, says it should not be used for critical/private data:
http://searchdatabase.techtarget.com/ateQuestionNResponse/0,289625,sid13_cid511679_tax285648,00.html

Posted by [name withheld] on Friday July 4 2003, @1:31pm[Delete] [Edit]

The 'expert' talked and talked about what he would do if he discovered an associate was holding confidential data in a MySQL database, but provided no grounding for his findings whatsoever.

On another note, notice that mysql doesnt follow their own recomendations. Here is the error i got while registering (notice they store the passwords in plain text, which they rrecomend against doing incase the system is comprimised):

INSERT user SET email='paul@mydomain.com',pass='lazypass',show_email='N',firstname='',lastname='',address='',city='',state='',zipcode='',country_id='',phone='',cell='',fax='',company='',title='',news='none',newsgroup='',created=NOW(),last_modified=NOW()
Duplicate entry 'paul@mydomain.com' for key 2Duplicate entry 'paul@mydomain.com' for key 2
INSERT user SET email=?,pass='lazypass',show_email='N',firstname='',lastname='',address='',city='',state='',zipcode='',country_id='',phone='',cell='',fax='',company='',title='',news='none',newsgroup='',created=NOW(),last_modified=NOW()

Posted by Ben Powell on Wednesday March 5 2003, @4:10am[Delete] [Edit]

You're right he didn't give examples of MySQL weaknesses; I don't follow the last part of your post (newbie). I think the new versions of MySQL are robust, and as with his comments re SQL Server, it is as much to do with the system you run it on and in this case I don't think you can fault Linux.

Posted by Ben Powell on Wednesday March 5 2003, @4:11am[Delete] [Edit]

On re-reading, do you mean to say this site is insecure :-)

Add your own comment.