ubuntu下安装mysql 5.7时, mysql 会自动生成密码. 我们找不到的, 解决方案

访问量: 332

修改 /etc/mysql/mysql.conf.d/mysqld.cnf

在 [mysqld] 下面,增加一行:  skip-grant-tables

 27 [mysqld]
 28 #
 29 # * Basic Settings
 30 #
 31 user    = mysql
 32 pid-file  = /var/run/mysqld/mysqld.pid
 33 socket    = /var/run/mysqld/mysqld.sock
 34 port    = 3306
 35 basedir   = /usr
 36 datadir   = /var/lib/mysql
 37 tmpdir    = /tmp
 38 lc-messages-dir = /usr/share/mysql
 39 skip-external-locking
 40 # 我加的
 41 skip-grant-tables

就可以了.

订阅/RSS Feed

Subscribe

分类/category