When you execute the command at a command prompt, the following error is reported
[Email protected]]# mysqladmin-u root password "Sorry"
Mysqladmin:connect to server at ' localhost ' failed
error: ' Access denied for user ' root ' @ ' localhost ' (using password:no) '
Workaround:
[Email protected]]# mysql-u root-p
Enter Password:
Welcome to the MariaDB Monitor. Commands End With; or \g.
Your MariaDB Connection ID is 110
Server Version:5.5.31-mariadb-log MariaDB Server
Copyright (c) Monty, Oracle, program Ab and others.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
MariaDB [(none)]> set password for ' root ' @ ' localhost ' =password (');
Query OK, 0 rows Affected (0.00 sec)
MariaDB [(None)]> flush privileges;
Query OK, 0 rows Affected (0.00 sec)
Problem solving
This article is from the "Cloud Life" blog, make sure to keep this source http://ovcer.blog.51cto.com/1145188/1653660
MySQL News ' Access denied for user ' root ' @ ' localhost ' (using Password:no) ' Error resolution