我不得不安装 mysql 8.0,因为以前的版本崩溃了。
现在我正在努力设置root密码。默认的空密码不起作用,我试过root
,mysql
作为密码,但它们不起作用。
我已经创建了初始化文件来重置密码。不幸的是,我的密码不被接受,这是我的日志:
2018-02-16T10:12:22.962733Z 0 [Warning] [MY-010139] Changed limits: max_open_files: 5000 (requested 8161)
2018-02-16T10:12:22.962815Z 0 [Warning] [MY-010142] Changed limits: table_open_cache: 2419 (requested 4000)
2018-02-16T10:12:23.160066Z 0 [System] [MY-010116] /usr/sbin/mysqld (mysqld 8.0.4-rc-log) starting as process 20059 ...
2018-02-16T10:12:24.013727Z 0 [Warning] [MY-010068] CA certificate ca.pem is self signed.
2018-02-16T10:12:24.026122Z 0 [Warning] [MY-010319] Found invalid password for user: 'root@localhost'; Ignoring user
2018-02-16T10:12:24.043758Z 6 [Warning] [MY-010319] Found invalid password for user: 'root@localhost'; Ignoring user
2018-02-16T10:12:24.050668Z 0 [System] [MY-010931] /usr/sbin/mysqld: ready for connections. Version: '8.0.4-rc-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL).
这是我当前的初始化文件内容:
SET GLOBAL validate_password.policy = 'LOW';
UPDATE mysql.user
SET authentication_string = PASSWORD('new_password'), password_expired = 'N'
WHERE User = 'root' AND Host = 'localhost';
FLUSH PRIVILEGES;
我尝试了很多不同的密码,没有一个有效。我尝试使用特殊字符和数字创建长度超过 16 个字符的密码,什么都没有。有什么建议我可以做些什么来重置密码并真正开始使用数据库?