Difference between revisions of "How to Set your MySQL Password"

From Brian Nelson Ramblings
Jump to: navigation, search
(Created page with "==How to Set your MySQL Password== One of the first things you should do on any MySQL install is set the root password. If you do not set the password anyone that gains acce...")
 
(Set root password)
 
Line 5: Line 5:
 
===Set root password===
 
===Set root password===
  
Make sure to start Percona
+
Make sure to start Percona/Mysql
  
 
  service mysql start
 
  service mysql start

Latest revision as of 18:02, 12 March 2014

How to Set your MySQL Password

One of the first things you should do on any MySQL install is set the root password. If you do not set the password anyone that gains access to your system will have access to everything in the database.

Set root password

Make sure to start Percona/Mysql

service mysql start

Log into mysql and check the users

mysql -u root
SELECT User, Host, Password FROM mysql.user;

Now set the root passwords

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('briansnelson');
SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('briansnelson');
SET PASSWORD FOR 'root'@'localhost.localdomain' = PASSWORD('briansnelson');
FLUSH PRIVILEGES;