Skip to content

Set MySQL root password on OS X

Share Button

Login To MySQL with:

$ mysql -u root

 

Set new password for MySQL User: (‘Kwacho’ is our new password)

mysql> Use mysql;
mysql> UPDATE user SET password=PASSWORD("Kwacho") WHERE user='root';
mysql> FLUSH PRIVILEGES;
mysql> quit

 

Login to MySQL with new Password: (Password is Capitalized!)

$ mysql -u root -p

 

If You’ll get an error of a type:

bash: mysql: command not found

It means that You’ll need to update you $PATH environment variable

 

Try with Following Command: (full path to mysql)

$ /usr/local/mysql/bin/mysql -u root -p Kwacho

 

Share Button