淘先锋百科网

首页 1 2 3 4 5 6 7

问题:

困扰了很久的问题

使用apt-get来安装mysql,安装好之后发现安装的是 MariaDB,如下,无需密码既可以登录了。即使使用mysqladmin设置好密码,用密码登录可以,不用密码登录也可以

root@ubuntu:/etc/mysql# mysql

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

Your MariaDB connection id is 35

Server version: 10.0.31-MariaDB-0ubuntu0.16.04.2 Ubuntu 16.04

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

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

排查思路:

第一看看my.conf有没有skip-grant-tables,跳过密码验证

过滤了下没有

196badcf4010c6d1198337d0dc410a65.png

看看my.cnf里面是不是把密码写进去了,查找了相关.cnf文件去看了看也没有

root@ubuntu:~# find / -name "*.cnf"

/usr/share/ssl