Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
mysql:security_tips [2013/01/02 17:51]
188.143.232.12 LmffUJPxOA
mysql:security_tips [2013/01/03 09:09] (current)
zagi old revision restored
Line 1: Line 1:
-It'joy to find smoenoe who can think like that+====== MySQL Security tips ====== 
 + 
 +**Never store the MySQL ‘root’ user password in ~root/.my.cnf file.** 
 + 
 +Do you need to store a MySQL password in a file? Yes. Connection management for your application is an example, however that use should never be ‘root’ user to connect to your application. 
 +You may also need to run scripts to backup your data with mysqldump. The solution is to create a dedicated user .e.g. ‘backup’, and then grant that user only the permissions necessary to do the specific task at hand. By default, a simple mysql command will never grant access without any authentication, the user will need to find the password. 
 + 
 +<code> 
 +$ mysql -uroot -p[password] 
 +mysql> create user dba@localhost identified by '[newpassword]'; 
 +mysql> grant all on *.* to dba@localhost with grant option; 
 +mysql> exit 
 + 
 +# Check you can really login 
 +$ mysql -udba -pnewpassword 
 +mysql> select host,user from mysql.user; 
 +# Drop 'root' users as listed, generally 
 +mysql> drop user root@127.0.0.1; 
 +mysql> drop user root@localhost; 
 +mysql> drop user root@[hostname]; 
 +mysql> select host,user from mysql.user; 
 +mysql> exit 
 +</code>
mysql/security_tips.1357145500.txt.gz · Last modified: 2013/01/02 17:51 by 188.143.232.12
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready