Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change mySQL root password in MAMP

Tags:

mysql

macos

mamp

I installed mySQL a while back but have now installed MAMP which also includes mySQL. I want to change the root user password in this new mySQL instance but I can't get this to work:

mysqladmin -u root -p --port=8889 --protocol=TCP password myNewPassword

(I have to use the port # and TCP protocol, otherwise it just tries to connect to my older mySQL instance)

The error I get is:

mysqladmin: [Warning] Using a password on the command line interface can be insecure. Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety. mysqladmin: unable to change password; error: 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '() IDENTIFIED BY 'myNewPassword'' at line 1'

What am I doing wrong?

like image 829
RossW Avatar asked Feb 05 '23 02:02

RossW


1 Answers

From the MAMP FAQ:

/Applications/MAMP/Library/bin/mysqladmin -u root -p password <NEWPASSWORD>

Replace with the new password. You need to provide the existing root user password (e.g. ‘root’).

Afterwards, you also need to change the password for phpMyAdmin and other scripts which are used with MAMP. You can change the password for phpMyAdmin in the file /Applications/MAMP/bin/phpMyAdmin/config.inc.php.

like image 149
RossW Avatar answered Feb 07 '23 16:02

RossW