2

I installed MySQL and the MySQL community server on my Hortonworks HDP. I started service and tried to change password

/usr/bin/mysql_secure_installation

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.
The 'validate_password' plugin is installed on the server.
The subsequent steps will run with the existing configuration
of the plugin.
Please set the password for root here.

New password: 

Re-enter new password: 

Estimated strength of the password: 50 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
 ... Failed! Error: The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

And this process is repeating again and again.

I deleted skip=grant-tables from my /etc/my.conf file

I tried what bart suggested, It worked in the first place but then i have the same problem.

I logged as a root.
mysql> create database registry;
Query OK, 1 row affected (0.05 sec)

mysql> CREATE USER 'registry'@'%' IDENTIFIED BY 'R12$%34qw';
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

How to fix this?

1 Answers1

1

Just stop and restart MySQL normally.

Edit

Otherwise:

Make sure you flush the privileges:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;

From the documentation:

FLUSH PRIVILEGES

Reloads the privileges from the grant tables in the mysql database.

The server caches information in memory as a result of GRANT and CREATE USER statements. This memory is not released by the corresponding REVOKE and DROP USER statements, so for a server that executes many instances of the statements that cause caching, there will be an increase in memory use. This cached memory can be freed with FLUSH PRIVILEGES.

Bart
  • 2,221