restarting mysql databases

Tom Rivers tom at impact-crater.com
Mon Oct 6 19:40:39 UTC 2014


On 10/6/2014 12:33, Robert Moskowitz wrote:
> mysqladmin -u root password 'mypass'
>
> failed with:
>
> mysqladmin: connect to server at 'localhost' failed
> error: 'Access denied for user 'root'@'localhost' (using password: NO)'

The form of the command should be something like this:

mysql -h localhost -u root -p

I wouldn't specify a password on the command line for security reasons.  
If you execute the command I posted above, you will be automatically 
prompted for the user's password.  Of course, if you just reset the 
database, the root user won't have a password so you should omit the 
"-p" argument.

Alternatively, you can always run /usr/bin/mysql_secure_installation and 
that will help secure your installation.  It will also help you set the 
root password.


Tom


More information about the users mailing list