deepin连接mariadb提示error 1698(28000)错误

在Ubuntu的衍生版linux系统中一般使用sudo apt-get install mariadb-server安装MariaDB,但是安装完后,可能会存在用普通用户连接MariaDB报错的情况,如下:

jzk@jzk-PC:/etc/mysql$ mysql -u root

ERROR 1698 (28000): Access denied for user 'root'@'localhost'

解决办法如下:

jzk@jzk-PC:/etc/mysql$ sudo mysql -uroot

Welcome to the MariaDB monitor.  Commands end with ; or \g.

Your MariaDB connection id is 31

Server version: 10.1.29-MariaDB-6+b1 Debian buildd-unstable

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use mysql;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

MariaDB [mysql]> update user set plugin='' where user='root';

Query OK, 1 row affected (0.00 sec)

Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [mysql]> flush privileges;

Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]> exit;

Bye

jzk@jzk-PC:/etc/mysql$ mysql -u root

Welcome to the MariaDB monitor.  Commands end with ; or \g.

Your MariaDB connection id is 32

Server version: 10.1.29-MariaDB-6+b1 Debian buildd-unstable

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,448评论 0 10
  • 【MySQL】Linux下MySQL 5.5、5.6和5.7的RPM、二进制和源码安装 1.1BLOG文档结构图 ...
    小麦苗DB宝阅读 10,619评论 0 31
  • 钱也不够花,出门无有余, 财神未能见,穷鬼长来闾, 我亦可奈何,望汝当归去, 路远恕难送,只在道上呼。
    释迦干屎橛阅读 322评论 0 1
  • 搜肠刮肚好多年后,我才无比确信,在我有限的记忆当中,对于高中生活,画面感最强,印象最为深刻的事。那是在某一次体育课...
    被窩阅读 402评论 0 0
  • 辛苦的一天,有日子没有一口气8小时练习,仿佛法国静修营。 上午的站立体式,梵克老师是以战二与侧角伸展式中,内侧腹股...
    青冥浩荡不见底阅读 591评论 0 1