2016/7/20 12:17:54 MariaDB 默认情况下,无法验证密码

1. System information:

  1. [[email protected] MgmtStatus]# cat /etc/redhat-release
  2. Red Hat Enterprise Linux Server release 7.2 (Maipo)
  3. [[email protected] MgmtStatus]# uname -a
  4. Linux mgt 3.10.0-327.el7.x86_64 #1 SMP Thu Oct 29 17:29:29 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux
  5. [[email protected] MgmtStatus]# rpm -qa | grep mariadb
  6. mariadb-server-5.5.44-2.el7.x86_64
  7. mariadb-5.5.44-2.el7.x86_64
  8. mariadb-libs-5.5.44-2.el7.x86_64
  9. [[email protected] MgmtStatus]#

2. 默认情况下,直接可以不需要密码访问,无法在本地验证自己创建的用户,以及密码

  1. [[email protected]_TestData ~]# mysql
  2. Welcome to the MariaDB monitor. Commands end with ; or \g.
  3. Your MariaDB connection id is 60
  4. Server version: 5.5.41-MariaDB MariaDB Server
  5. Copyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.
  6. Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.
  7. MariaDB [(none)]>

3. 通过查看当前登录用户的属性,可以发现有一个空账户。

  1. MariaDB [(none)]> show grants;
  2. +---------------------------------------------------------------------+
  3. | Grants for [email protected] |
  4. +---------------------------------------------------------------------+
  5. | GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘localhost‘ WITH GRANT OPTION |
  6. | GRANT PROXY ON ‘‘@‘‘ TO ‘root‘@‘localhost‘ WITH GRANT OPTION |
  7. +---------------------------------------------------------------------+
  8. 2 rows in set (0.01 sec)
  9. MariaDB [(none)]>

4. 查找user table , 有2个用户名为空的账户,随着包安装的时候,就存在,目前不知道其用途。

  1. MariaDB [(none)]> use mysql
  2. Reading table information for completion of table and column names
  3. You can turn off this feature to get a quicker startup with -A
  4. Database changed
  5. MariaDB [mysql]> select user,host,password from user where user=‘‘;
  6. +------+----------------+----------+
  7. | user | host | password |
  8. +------+----------------+----------+
  9. | | localhost | |
  10. | | rack\_testdata | |
  11. +------+----------------+----------+
  12. 2 rows in set (0.00 sec)
  13. MariaDB [mysql]>

5 删除之后就可以采用密码形式访问了。

  1. [[email protected] MgmtStatus]# mysql
  2. ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)
  3. [[email protected] MgmtStatus]# mysql -u root -p
  4. Enter password:
  5. ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)
  6. [[email protected] MgmtStatus]# mysql -u root -p
  7. Enter password:
  8. Welcome to the MariaDB monitor. Commands end with ; or \g.
  9. Your MariaDB connection id is 26
  10. Server version: 5.5.44-MariaDB MariaDB Server
  11. Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
  12. Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.
  13. MariaDB [(none)]> use mysql
  14. Reading table information for completion of table and column names
  15. You can turn off this feature to get a quicker startup with -A
  16. Database changed
  17. MariaDB [mysql]> select user,host,password from user where user=‘‘;
  18. Empty set (0.01 sec)
  19. MariaDB [mysql]> select user,host,password from user;
  20. +----------------+-----------+-------------------------------------------+
  21. | user | host | password |
  22. +----------------+-----------+-------------------------------------------+
  23. | root | localhost | *8DB8413E28D4DB2FF73A45BACED76C20FE607F41 |
  24. | root | mgt | *8DB8413E28D4DB2FF73A45BACED76C20FE607F41 |
  25. | root | 127.0.0.1 | *8DB8413E28D4DB2FF73A45BACED76C20FE607F41 |
  26. | root | ::1 | *8DB8413E28D4DB2FF73A45BACED76C20FE607F41 |
  27. | computenodedba | % | *920F6DF0856242E405A8059E19930A80912A00FC |
  28. +----------------+-----------+-------------------------------------------+
  29. 5 rows in set (0.00 sec)
  30. MariaDB [mysql]>

来自为知笔记(Wiz)

时间: 2024-08-03 20:48:49

2016/7/20 12:17:54 MariaDB 默认情况下,无法验证密码的相关文章

默认情况下,不使用of子句表示在select所有的数据表中加锁(转)

Select …forupdate语句是我们经常使用手工加锁语句.通常情况下,select语句是不会对数据加锁,妨碍影响其他的DML和DDL操作.同时,在多版本一致读机制的支持下,select语句也不会被其他类型语句所阻碍. 借助for update子句,我们可以在应用程序的层面手工实现数据加锁保护操作.本篇我们就来介绍一下这个子句的用法和功能. 下面是采自Oracle官方文档<SQLLanguage Reference>中关于for update子句的说明:(请双击点开图片查看) 从for

mysql5.6默认情况下内存占用太大

下载了mysql5.6.12 ,默认占用内存达400多M,  而原来使用的5.0 只有30M.. 解决方案:调整以下参数----------------performance_schema_max_table_instances=600table_definition_cache=400table_open_cache=256 这样下来,mysql5.6.12就只使用  40---60M左右的内存了. 以下是5.6默认的设置performance_schema_max_table_instanc

[VS] - &quot;包含了重复的“Content”项。.NET SDK 默认情况下包括你项目中的“Content”项。&quot; 之解决

背景 VS 2017 升级至  VS 2017 v15.3 后,.Net Core 1.1 应用编译报错: Error: 包含了重复的"Content"项..NET SDK 默认情况下包括你项目中的"Content"项.可以从项目文件中删除这些项,或者如果希望将其显示包含在项目文件中,则可以将"EnableDefaultContentItems"属性设置为"false". Error : Duplicate 'Content'

jquery Tab默认情况下自动切换

<!DOCTYPE html><html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />&l

如何使用终端默认情况下阻止Mac应用保存到iCloud

当您保存要在Mac上的Pages,Numbers,TextEdit或其他基于云的应用程序中处理的文档时,该保存的默认位置是iCloud.尽管这对某些人或某些文档来说可能是一件好事,但您可能会厌倦每次更改该位置以保存到其他位置. 如果您希望默认情况下阻止Mac应用保存到iCloud,可以使用Terminal进行操作,我们将向您展示如何进行. 在Mac上打开终端 如果您熟悉使用Terminal并经常使用,请继续打开它.如果不是,您可以通过几种方式快速打开Terminal. 在Finder打开的情况下

默认情况下安装的应用程序C盘后提示权限不足,当你开始介意。。。

最近,不少用户抱怨的经销商.正在使用win 7我们的计算机系统上安装软件后,提示权限不够开放系统,无法启动软件. 在xp该系统是没有问题的.原因是,我们会选择在默认安装路径系统C-disk.和win 7系统在安装软件时,有些时候 没有管理员权限时可能会提示权限不足.或者在安装软件时.用户仅仅是选择了仅仅是让当前用户能够使用该软件,这样其它用 户登录时则无法使用软件了. 考虑到用户的计算机操作水平有限,我们认为将安装程序的默认路径设置在D盘,以降低用户的疑问和咨询.方便用户 的使用. 所以我后来又

在Windows下如何创建虚拟环境(默认情况下)

很多小伙伴平时在使用Python的时候,有的项目需要使用Python2来进行开发,有的项目则是需要Python3来进行开发.当不清楚怎么分开环境的时候,此时两个环境开始打架,彼此傻傻分不清楚.虚拟环境作为隔离的利器应运而生,其实虚拟环境最大的好处就是将我们的开发环境进行隔离,让彼此相互不受影响.今天,小编给大家简单的介绍一下如何在Windows下创建虚拟环境,具体的教程如下. 1.虚拟环境需要用到的库是virtualenv,需要使用安装命令pip install virtualenv进行安装,如

VC6下 try catch 在release下的杯具(默认情况下,要加上throw语句catch才不会被优化掉)

IDE:VC6 今天遇到一个小问题,把我郁闷了好久,××医生的VulEngine不时在wcsstr处发生crash,加了一番强大的参数检查后,再加上了强大的try catch,其实不是很喜欢用try和catch,总觉得一个完美的程序,应该代码的每一处都可以被程序员控制的,我倾向如对函数的返回值和参数进行强制的检查,当然这就要求你自己设计的函数必须也得满足这些要求,不过事情牵扯到读写文件,处理字符串等等繁琐的操作,偶尔用一用try catch是比较简洁的,我在wcsstr前后加上异常处理代码后,d

idea默认情况下从svn checkout项目报错解决方法

报错:Cannot load supported formats: Cannot run program "svn": CreateProcess error=2 解决方法 file->setting->version control->subversion->general中两个选中的复选框取消后,保存设置后,再重新checkout就可以了.