'No temporary password in mysqld.log
I used mysql 5.7.16 community and centos 7.
I'm following a video tutorial to install mysql:
- wget http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
- yum localinstall dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
- yum repolist enabled | grep "mysql.-community."
- yum install mysql-community-server
- service mysqld start
After starting mysql, I can see status is alive (running) with service mysqld status.
But I can' get anything by: grep 'temporary password' /var/log/mysqld.log
msyqld.log (ignore normal logs):
[Warning] InnoDB: Cannot open table mysql/plugin from the internal data dictionary of InnoDB though the .frm file for the table exists.
mysqld: Table 'mysql.plugin' doesn't exist
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
[Warning] InnoDB: Cannot open table mysql/gtid_executed from the internal data dictionary of InnoDB though the .frm file for the table exists.
mysqld: Table 'mysql.gtid_executed' doesn't exist
[Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
[Warning] InnoDB: Cannot open table mysql/server_cost from the internal data dictionary of InnoDB though the .frm file for the table exists.
[Warning] Failed to open optimizer cost constant tables
[Warning] InnoDB: Cannot open table mysql/time_zone_leap_second from the internal data dictionary of InnoDB though the .frm file for the table exists.
[Warning] Can't open and lock time zone table: Table 'mysql.time_zone_leap_second' doesn't exist trying to live without them
[Warning] InnoDB: Cannot open table mysql/servers from the internal data dictionary of InnoDB though the .frm file for the table exists.
[ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
Appreciate any help!
Solution 1:[1]
If there is no password, don't worry. Do it.
sudo mysql_secure_installation
just press the enter as you don't have password.
Solution 2:[2]
I simply restarted mysql and searched:
service mysqld start
grep 'temporary password' /var/log/mysqld.log
Default password was displayed.
Solution 3:[3]
Try
sudo grep 'temporary password' /var/log/mysqld.log | rev | cut -d" " -f1 | rev | tr -d "."
pwd will be displayed after.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Atul6.Singh |
| Solution 2 | Ardent Coder |
| Solution 3 | benson23 |
