时间:2021-07-01 10:21:17 帮助过:3人阅读
Red Hat Enterprise Linux Server release 7.2 (Maipo)[root@mgt MgmtStatus]# uname -aLinux 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[root@mgt MgmtStatus]# rpm -qa | grep mariadbmariadb-server-5.5.44-2.el7.x86_64mariadb-5.5.44-2.el7.x86_64mariadb-libs-5.5.44-2.el7.x86_64[root@mgt MgmtStatus]# 3. 通过查看当前登录用户的属性,可以发现有一个空账户。
[root@Rack_TestData ~]# mysqlWelcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 60Server version: 5.5.41-MariaDB MariaDB ServerCopyright (c) 2000, 2014, Oracle, MariaDB Corporation Ab and others.Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.MariaDB [(none)]>
4. 查找user table , 有2个用户名为空的账户,随着包安装的时候,就存在,目前不知道其用途。
MariaDB [(none)]> show grants;+---------------------------------------------------------------------+| Grants for root@localhost |+---------------------------------------------------------------------+| GRANT ALL PRIVILEGES ON *.* TO ‘root‘@‘localhost‘ WITH GRANT OPTION || GRANT PROXY ON ‘‘@‘‘ TO ‘root‘@‘localhost‘ WITH GRANT OPTION |+---------------------------------------------------------------------+2 rows in set (0.01 sec)MariaDB [(none)]>
5 删除之后就可以采用密码形式访问了。
MariaDB [(none)]> use mysqlReading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedMariaDB [mysql]> select user,host,password from user where user=‘‘;+------+----------------+----------+| user | host | password |+------+----------------+----------+| | localhost | || | rack\_testdata | |+------+----------------+----------+2 rows in set (0.00 sec)MariaDB [mysql]>
[root@mgt MgmtStatus]# mysqlERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)[root@mgt MgmtStatus]# mysql -u root -pEnter password:ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)[root@mgt MgmtStatus]# mysql -u root -pEnter password:Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 26Server version: 5.5.44-MariaDB MariaDB ServerCopyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.MariaDB [(none)]> use mysqlReading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changedMariaDB [mysql]> select user,host,password from user where user=‘‘;Empty set (0.01 sec)MariaDB [mysql]> select user,host,password from user;+----------------+-----------+-------------------------------------------+| user | host | password |+----------------+-----------+-------------------------------------------+| root | localhost | *8DB8413E28D4DB2FF73A45BACED76C20FE607F41 || root | mgt | *8DB8413E28D4DB2FF73A45BACED76C20FE607F41 || root | 127.0.0.1 | *8DB8413E28D4DB2FF73A45BACED76C20FE607F41 || root | ::1 | *8DB8413E28D4DB2FF73A45BACED76C20FE607F41 || computenodedba | % | *920F6DF0856242E405A8059E19930A80912A00FC |+----------------+-----------+-------------------------------------------+5 rows in set (0.00 sec)MariaDB [mysql]>
2016/7/20 12:17:54 MariaDB 默认情况下,无法验证密码
标签: