Home MySQL 5.7.20 unable to set root password
Reply: 1

MySQL 5.7.20 unable to set root password

John Published in 2017-11-03 15:31:12Z

I installed MySQL Server 5.7.20 on ubuntu 14.04 and i can log in to server using:

mysql -u root -p

password is blank...how can i set mysql root password in terminal before install mysql server?

I installed it using silent install and try to run from terminal this mysql query:

SET PASSWORD FOR 'root'@'localhost' = 'mypasswordhere';

But i im getting this:

Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> SHOW warnings;
| Level | Code | Message                                                                                                    |
| Note  | 1699 | SET PASSWORD has no significance for user 'root'@'localhost' as authentication plugin does not support it. |
1 row in set (0.00 sec)

So what i im doing wrong? I just want to change from blank password for user root to mypasswordhere password...how it needs to be done?

Valuator Reply to 2017-11-03 15:52:56Z


ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mypasswordhere';

From https://www.percona.com/blog/2016/03/16/change-user-password-in-mysql-5-7-with-plugin-auth_socket/

If you install 5.7 and don’t provide a password to the root user, it will use the auth_socket plugin. That plugin doesn’t care and doesn’t need a password. It just checks if the user is connecting using a UNIX socket and then compares the username. If we want to configure a password, we need to change the plugin and set the password at the same time, in the same command.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.495322 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO