Skip to Content

ERROR creating DB user in MySQL 8.0

MySQL Version 8 Errors: Password Hash and User Access Issues


ERROR 1: creating DB user: Password hash should be a 41-digit hexadecimal number (0)   

ERROR 2: granting access for DB user: Can't find any matching row in the user table (0)


Overview: This article addresses two common errors encountered when working with MySQL Version 8: the Password hash should be a 41-digit hexadecimal number (0) error when creating a database user and the Can't find any matching row in the user table (0) error when granting access. These issues can be resolved by configuring MySQL to use the mysql_native_password authentication plugin. This requires editing the MySQL configuration file and restarting the MySQL service.


  For MySQL 8.0 and above, add the following to /etc/mysql/mysql.conf.d/mysqld.cnf configuration file under [mysqld]

root@localhost: vi /etc/mysql/mysql.conf.d/mysqld.cnf

[mysqld]
 
default_authentication_plugin=mysql_native_password 
 

root@localhost: service mysql restart 


Related Articles