Home  >  Article  >  Database  >  Where can I find the initial password of mysql?

Where can I find the initial password of mysql?

王林
王林Original
2020-09-29 14:29:2312375browse

The initial password of mysql can be viewed in the log. The specific method is: first log in to mysql; then execute the [grep 'temporary password' /var/log/mysqld.log] statement.

Where can I find the initial password of mysql?

How to view the initial password:

(Recommended tutorial: mysql tutorial)

Start mysql

systemctl start mysqld

View mysql status

systemctl status mysqld

Log in to the database

mysql -u root -p

After starting mysql, the initial password will be written to the log

Use the following command View

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

Where can I find the initial password of mysql?

Related recommendations: php training

The above is the detailed content of Where can I find the initial password of mysql?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn