Difference between revisions of "Secure your mysql"

From mx Help Wiki
Jump to: navigation, search
(Securing MySQL)
m
 
Line 7: Line 7:
 
Changing the database administrator's password (empty by default). First run MySQL (if it is not already):
 
Changing the database administrator's password (empty by default). First run MySQL (if it is not already):
  
yourterminal$ mysql -u root -p
+
yourterminal$ mysql -u root -p
  
 
when prompted for a password leave it blank (i.e., just hit 'return')
 
when prompted for a password leave it blank (i.e., just hit 'return')
Line 13: Line 13:
 
then change the administrator's password as follows:
 
then change the administrator's password as follows:
  
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yournewpaswd');
+
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yournewpaswd');
  
 
But replace yournewpaswd (keep the single quotes in there though) with a password that '''you will not forget'''.
 
But replace yournewpaswd (keep the single quotes in there though) with a password that '''you will not forget'''.

Latest revision as of 16:38, 19 January 2007

[edit] Securing MySQL

(the following instructions adapted from http://www.securityfocus.com/infocus/1726)

Change admin password

Changing the database administrator's password (empty by default). First run MySQL (if it is not already):

yourterminal$ mysql -u root -p

when prompted for a password leave it blank (i.e., just hit 'return')

then change the administrator's password as follows:

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yournewpaswd');

But replace yournewpaswd (keep the single quotes in there though) with a password that you will not forget.

Personal tools