MySQL Forums
Forum List  »  Install & Repo

Re: Finding root password on new 5.7 install
Posted by: Charles Wangersky
Date: May 05, 2020 11:27AM

Okay - so I figured best course was to modify the my.sql file to include the skip-grant-tables option, just in case part of the issue was with the way the daemon was being started from the command line, rather than via systemd. Restarted the service, and:

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> alter user 'root' identified with mysql_native_password by 'somepassword';
ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'%'

# Well, OK; maybe it wants the full name of the user.

mysql> alter user 'root'@'localhost' identified with mysql_native_password by 'somepassword';
Query OK, 0 rows affected (0.02 sec)

# Whew! That worked. Or did it?

mysql> quit
Bye

Edit my.cnf, restart mysql:

mysql --user root --password
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.30-0ubuntu0.18.04.1 (Ubuntu)

Finally! Thank you...

Options: ReplyQuote




Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.