I tried to change my PHP login to MySQL 8.0 from using caching_sha2_password to mysql_native_password as below. Now I can't login at all to MySQL. I have restarted the mysqld to no avail.
Any ideas to remedy?
I followed this article php mysqli_connect: authentication method unknown to the client [caching_sha2_password]
mysql> ALTER USER 'elstatuser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mysecretpassword';
ERROR 3009 (HY000): Column count of mysql.user is wrong. Expected 50, found 49. Created with MySQL 80012, now running 80013. Please use mysql_upgrade to fix this error.
[root@han ~]# mysql_upgrade --force -uroot -p
Enter password:
Checking server version.
Running queries to upgrade MySQL server.
Upgrading system table data.
Checking system database.
mysql.columns_priv OK
mysql.component OK
mysql.db OK
mysql.default_roles OK
mysql.engine_cost OK
mysql.func OK
mysql.general_log OK
mysql.global_grants OK
mysql.gtid_executed OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.password_history OK
mysql.plugin OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.role_edges OK
mysql.server_cost OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.slow_log OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
The sys schema is already up to date (version 2.0.0).
Checking databases.
elstat.account OK
[...]
wp.wp_users OK
Upgrade process completed successfully.
Checking if update is needed.
[root@han ~]# logout
[thommym@han ~]$ mysql -u root -p
Enter password:
ERROR 3118 (HY000): Access denied for user 'root'@'localhost'. Account is locked.
[thommym@han ~]$