Setting the Root Password

Oct 31, 2008 Author: vvaswani

As you probably noticed when you logged in just now, you had to supply a username "root" but not a password. The initial installation of MySQL has no root password set. It's really important to set this password for obvious security reasons. In the MySQL monitor, type the following: set password for root@localhost=password('your password'); Obviously, you should replace your password with whatever you would like the root password to be. Log out (\q) and then log back in. This time, you need to log in like this: mysql -u root -p MySQL then prompts you for your password. The -u means username, and the -p means log in with password.


views 4716
  1. Add New Comment