Securing MySQL

Due to differing needs and requirements this is difficult to answer except on a case by case basis. The MySQL website has a section regarding general security of a MySQL database available here: http://dev.mysql.com/doc/refman/5.0/en/security.html

Additionally some good practices are:


1. Verify your root MySQL account password is set


2. the test account and database that were created during the initial installation

Login to mysql as root, from the command prompt "shell> mysql -u root -p mysql" and enter the password when prompted
mysql> drop database test;
mysql> use mysql;
mysql> delete from user where user='test';
mysql> delete from user where user='';
mysql> flush privileges;
3. Make sure that each account has a password set


4. Do not grant global privileges unnecessarily


5. Avoid using wildcards in the hostname value associated with accounts


6. Periodically review users and databases that are setup in MySQL


7. Do not use passwords on the command line. From the command line you can login to MySQL using "shell> mysql -u root -password=somepassword mysql" the problem with this is anyone on the server could view your password with a simple process list command "shell> ps". The correct usage would be: "shell> mysql -u root -p mysql", from this MySQL will prompt your for your password and it will not show up in the process list as plain text.

  • 1 användare blev hjälpta av detta svar
Hjälpte svaret dig?

Relaterade artiklar

How do I export and import a mysql db using PHPMyAdmin?

Step 1: Open phpMyAdmin and select the database from where you want to export data and/or...

Does your MySQL server support extended character sets, foreign character sets, and collation sets?

In the control panel's left-hand side of the page, there should be a MySQL version for your...

Can I use MySQL Front to access my database?

You can remotely connect to your database by using your domain name as the host you are...

How do I rename a table in phpMyAdmin?

Here is a step-by-step for renaming a table: 1. Log into cPanel 2. Click on "MySQL Databases"...