ubuntu服务器16.04中mysql的默认密码 [英] Default password of mysql in ubuntu server 16.04

查看:374
本文介绍了ubuntu服务器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.

这篇关于ubuntu服务器16.04中mysql的默认密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆