No temporary password in mysqld.log
Asked Answered
P

4

7

I used mysql 5.7.16 community and centos 7.

I'm following a video tutorial to install mysql:

  1. wget http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
  2. yum localinstall dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
  3. yum repolist enabled | grep "mysql.-community."
  4. yum install mysql-community-server
  5. 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!

Pickerelweed answered 12/11, 2016 at 9:2 Comment(0)
P
14

I figured this out.

  1. I install centos 7 with mysql selected, mysql version is 5.5.
  2. Remove it by: yum remove mysql-serverl.
  3. Install 5.7.16 by this tutorial.
  4. Has these error.
  5. Yum remove mysql-community-server, install 5.7 again.
  6. Still has these error.
  7. Yum remove mysql-community-server, but delete dir /var/lib/mysql.
  8. Then install again, it works.

The key point is need to remove /var/lib/mysql manually.

Pickerelweed answered 12/11, 2016 at 13:9 Comment(1)
Thanks, removing /var/lib/mysql and reinstalling mysql did it for me!Muskogee
L
9

If there is no password, don't worry. Do it.

sudo mysql_secure_installation

just press the enter as you don't have password.

Lethargy answered 1/1, 2019 at 19:36 Comment(1)
thanks i thought Centos 7 would have the password as its in the same family with FedoraSesquialtera
B
7

I simply restarted mysql and searched:

service mysqld start

grep 'temporary password' /var/log/mysqld.log

Default password was displayed.

Bushnell answered 14/5, 2020 at 10:19 Comment(1)
your solution is simple and work prefectly ! thank youDepredate
R
0

Try

sudo grep 'temporary password' /var/log/mysqld.log | rev | cut -d" " -f1 | rev | tr -d "."

pwd will be displayed after.

Rochellrochella answered 26/2, 2022 at 13:59 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Quincy

© 2022 - 2024 — McMap. All rights reserved.