热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Incorrectsyntaxcreatinganuserusingmysql_native_passwordwithMariaDB

AccordingtoMariaDBdocs(https://mariadb.com/kb/en/mariadb/development-pluggable-authe

According to MariaDB docs (https://mariadb.com/kb/en/mariadb/development-pluggable-authentication/), the correct syntax to create an user with mysql_native_password plugin is:

1
CREATE USER asd IDENTIFIED VIA mysql_native_password USING '***';

And today phpMyAdmin 4.5.0.2 is using this syntax:

1
CREATE USER 'asd'@'%' IDENTIFIED WITH mysql_native_password BY '***';

This is generating errors "1065 - Query was empty" error above the printed query and "The selected user was not found in the privilege table." right on top of the user creation wizard.

I was able to create the user directly in SQL Query with the syntax pointed at MariaDB docs. (got password hash using

1
select PASSWORD('test');

).

Versions:
phpMyAdmin 4.5.0.2
MariaDB 10.0.20-MariaDB

该提问来源于开源项目:phpmyadmin/phpmyadmin

Hi,



there is a bug for this. If you create new user through phpmyadmin this is the syntax that is used:

CREATE USER 'test'@'localhost' IDENTIFIED VIA mysql_native_password USING '***';



And it works. But when you login with that username and change password it says changed but it really is not. If you logout and login with new password you will fail. You cannot login with new password but with old one you can. This is shown in the log:

21:37:08 [Warning] 'user' entry 'test' has both a password and an authentication plugin specified. The password will be ignored.

If you delete in mysql.user of the user test field plugin, then new password is working. Any idea?


   



推荐阅读
author-avatar
123454ewefewf
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有