Mysql初始化之后,错误文档里没有随机密码

执行 mysql -initialize之后,启动了mysql服务。
再var/log里找到了mysqld.log,但是里面并没有生成的临时密码,怎么破

[root@Lettiy log]# more mysqld.log
2017-08-10T07:24:57.951732Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead
2017-08-10T07:25:48.096043Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-08-10T07:25:48.098429Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.17) starting as process 27156 ...
2017-08-10T07:25:48.101563Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-08-10T07:25:48.101599Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-08-10T07:25:48.101608Z 0 [Note] InnoDB: Uses event mutexes
2017-08-10T07:25:48.101616Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-08-10T07:25:48.101627Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-08-10T07:25:48.101636Z 0 [Note] InnoDB: Using Linux native AIO
2017-08-10T07:25:48.101934Z 0 [Note] InnoDB: Number of pools: 1
2017-08-10T07:25:48.102049Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-08-10T07:25:48.103561Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-08-10T07:25:48.113043Z 0 [Note] InnoDB: Completed initialization of buffer pool
2017-08-10T07:25:48.125171Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2017-08-10T07:25:48.137118Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2017-08-10T07:25:48.151431Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2017-08-10T07:25:48.151478Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2017-08-10T07:25:48.347595Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2017-08-10T07:25:48.349071Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2017-08-10T07:25:48.349085Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2017-08-10T07:25:48.350196Z 0 [Note] InnoDB: 5.7.17 started; log sequence number 2534561
2017-08-10T07:25:48.350863Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2017-08-10T07:25:48.351759Z 0 [Note] InnoDB: Buffer pool(s) load completed at 170810 15:25:48
2017-08-10T07:25:48.352224Z 0 [Note] Plugin 'FEDERATED' is disabled.
2017-08-10T07:25:48.356787Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2017-08-10T07:25:48.357006Z 0 [Warning] CA certificate ca.pem is self signed.
2017-08-10T07:25:48.378054Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2017-08-10T07:25:48.378123Z 0 [Note] IPv6 is available.
2017-08-10T07:25:48.378136Z 0 [Note] - '::' resolves to '::';
2017-08-10T07:25:48.378160Z 0 [Note] Server socket created on IP: '::'.
2017-08-10T07:25:48.388626Z 0 [Note] Event Scheduler: Loaded 0 events
2017-08-10T07:25:48.389012Z 0 [Note] Executing 'SELECT * FROM INFORMATION_SCHEMA.TABLES;' to get a list of tables using the deprecated partition engine. You may use the startup option '--disab
le-partition-engine-check' to skip this check.
2017-08-10T07:25:48.389024Z 0 [Note] Beginning of list of non-natively partitioned tables
2017-08-10T07:25:48.400722Z 0 [Note] End of list of non-natively partitioned tables
2017-08-10T07:25:48.401022Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.17' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
2017-08-10T07:26:20.614367Z 3 [Note] Access denied for user 'root'@'localhost' (using password: YES)
2017-08-10T07:56:58.334920Z 4 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2017-08-10T07:57:05.644582Z 5 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2017-08-10T07:57:50.783465Z 6 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2017-08-10T08:02:28.660833Z 7 [Note] Access denied for user 'root'@'localhost' (using password: YES)
2017-08-10T08:14:42.559242Z 8 [Note] Access denied for user 'root'@'localhost' (using password: NO)
2017-08-10T08:16:11.932811Z 9 [Note] Access denied for user 'root'@'localhost' (using password: YES)

4个回答

麻烦提供一下你的mysql版本。不同的版本这个密码是不一样的。
①检查var/log/mysqld.log中的密码
②检查mysql用户根目录下的.mysql_secret文件,可以使用find / -name "*mysql_secret*"查找这个文件

另外你是否使用了--initialize-insecure参数安装数据库?如果用的是--initialize-insecure初始化数据库的话,是不会生成随机密码的,初始密码为空登录一下试试。

qq_36308377
缘 点 真的为空,感谢
8 个月之前 回复
qq_42569672
qq_42569672 感谢,果然是因为--initialize-insecure初始化数据库,空密码登录就好了
一年多之前 回复
qq_34405283
_Rekent [root@Lettiy ~]# mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
大约 3 年之前 回复
qq_34405283
_Rekent 空密码不行,我试过
大约 3 年之前 回复
qq_34405283
_Rekent mysql-5.7.17.el7.x86_64.rpm_bundle
大约 3 年之前 回复

随机密码不是在你输入完命令后打印在命令窗口里的吗?这么机密重要的东西会放在log日志里,???

qq_40709110
只希望变强 你没领悟别人意思
6 个月之前 回复

可以用终端(cmd)进行密码重置,百度一下

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐