ubuntu server 16.04 mysql的默认密码

我已经安装了 ubuntu 16.04 服务器.mysql服务器默认安装在里面.当我尝试使用 mysql -u root -p 访问 mysql 时,我无法登录到 mysql,因为我没有密码.有没有默认密码?

I have installed ubuntu 16.04 server. Mysql server was installed by default in it. When I am trying to access the mysql with mysql -u root -p, I am unable to log in to mysql because I dont have the password. Is there any default password?

我也试过 --skip-grant-tables,即使这样也行不通.即使尝试仅使用 mysql -u root 登录也是失败的.

I have also tried with --skip-grant-tables, even this does not work. Even trying to log in with just mysql -u root is a failure.

推荐答案

这就是你要找的:
sudo mysql --defaults-file=/etc/mysql/debian.cnf
基于 Debian 的 Linux 上的 MySql 通常使用带有凭据的配置文件.

This is what you are looking for:
sudo mysql --defaults-file=/etc/mysql/debian.cnf
MySql on Debian-base Linux usually use a configuration file with the credentials.

相关文章