The server requested authentication method unknown to the client
mysqli::real_connect(): (HY000/2054): The server requested authentication method unknown to the client [auth_gssapi_client]
this error occurs if i try to login using root user only
mysql> SELECT user, host, plugin FROM mysql.user ORDER BY user, host; +-------------+--------------+-----------------------+ | User | Host | plugin | +-------------+--------------+-----------------------+ | PUBLIC | | | | mariadb.sys | localhost | mysql_native_password | | root | 127.0.0.1 | mysql_native_password | | root | ::1 | mysql_native_password | | root | localhost | mysql_native_password | | root | simrankumari | mysql_native_password | +-------------+--------------+-----------------------+ 6 rows in set (0.00 sec)
sql -- 1. Create the database CREATE DATABASE `12te_12testers`; -- 2. Create the user and set the password -- We use 'localhost' as defined in DB_HOST. CREATE USER '12te_12testers'@'localhost' IDENTIFIED BY 'xwDdemZ007dummy'; -- 3. Grant all privileges on the database to the new user GRANT ALL PRIVILEGES ON `12te_12testers`.* TO '12te_12testers'@'localhost'; -- 4. Apply the changes immediately FLUSH PRIVILEGES;
mysql> SELECT user, host, plugin FROM mysql.user ORDER BY user, host; +----------------+--------------+-----------------------+ | User | Host | plugin | +----------------+--------------+-----------------------+ | 12te_12testers | localhost | mysql_native_password | | PUBLIC | | | | mariadb.sys | localhost | mysql_native_password | | root | 127.0.0.1 | mysql_native_password | | root | ::1 | mysql_native_password | | root | localhost | mysql_native_password | | root | simrankumari | mysql_native_password | +----------------+--------------+-----------------------+ 7 rows in set (0.00 sec)
to start mariadb
net start MariaDB
after deleting all root user and then recreating fix the issue
mysql> SELECT user, host, plugin FROM mysql.user ORDER BY user, host; +----------------+--------------+-----------------------+ | User | Host | plugin | +----------------+--------------+-----------------------+ | 12te_12testers | localhost | mysql_native_password | | PUBLIC | | | | mariadb.sys | localhost | mysql_native_password | | root | 127.0.0.1 | mysql_native_password | | root | ::1 | mysql_native_password | | root | localhost | mysql_native_password | | root | simrankumari | mysql_native_password | +----------------+--------------+-----------------------+ 7 rows in set (0.00 sec) mysql> DROP USER 'root'@'::1'; Query OK, 0 rows affected (0.00 sec) mysql> DROP USER 'root'@'simrankumari'; Query OK, 0 rows affected (0.00 sec) mysql> DROP USER 'root'@'127.0.0.1'; Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) mysql> SELECT user, host, plugin FROM mysql.user ORDER BY user, host; +----------------+-----------+-----------------------+ | User | Host | plugin | +----------------+-----------+-----------------------+ | 12te_12testers | localhost | mysql_native_password | | PUBLIC | | | | mariadb.sys | localhost | mysql_native_password | | root | localhost | mysql_native_password | +----------------+-----------+-----------------------+ 4 rows in set (0.00 sec) mysql> DROP USER IF EXISTS 'root'@'localhost'; Query OK, 0 rows affected (0.00 sec) mysql> CREATE USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'BUm@2AUgcs'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BY 'BUm@2AUgcs'' at line 1 mysql> CREATE USER 'root'@'localhost' IDENTIFIED BY 'BUm@2AUgcs'; Query OK, 0 rows affected (0.00 sec) mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'BUm@2AUgcs'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BY 'BUm@2AUgcs'' at line 1 mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION; Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) mysql> SELECT user, host, plugin FROM mysql.user WHERE user = 'root' AND host = 'localhost'; +------+-----------+-----------------------+ | User | Host | plugin | +------+-----------+-----------------------+ | root | localhost | mysql_native_password | +------+-----------+-----------------------+ 1 row in set (0.00 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | 12te_12testers | | bum | | information_schema | | mysql | | performance_schema | | sys | | test | +--------------------+ 7 rows in set (0.01 sec) mysql> SELECT user, host, plugin FROM mysql.user ORDER BY user, host; +----------------+-----------+-----------------------+ | User | Host | plugin | +----------------+-----------+-----------------------+ | 12te_12testers | localhost | mysql_native_password | | PUBLIC | | | | mariadb.sys | localhost | mysql_native_password | | root | localhost | mysql_native_password | +----------------+-----------+-----------------------+ 4 rows in set (0.00 sec) mysql>
Comments
Post a Comment