Skip navigation links

User Comments

Posted by Shawn Reeves on November 16 2011 6:37am[Delete] [Edit]

A more secure example of using mysqladmin to set the initial passwords. If you use the ways this document suggests, your password will show in shell history.
But this way, your password never shows and doesn't go into shell history:
mysqladmin -u root -h localhost password
Then you will be prompted for the new password.
Repeat for each user/host in the initial tables.

From the man page:
As of MySQL 5.5.3, the new password can be omitted following the password command. In this case, mysqladmin prompts for the password value, which enables you to avoid specifying the password on the command line. Omitting the password value should be done only if password is the final command on the mysqladmin command line. Otherwise, the next argument is taken as the password.

Posted by Brian Pete on July 2 2014 7:50am[Delete] [Edit]

Checkout for securing MySQL accounts