In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-11-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
One of the main new features of mysql5.7 is the great enhancement of security. After installing Mysql, a random password is created by default for root@localhost users. This random password needs to be looked up in different ways on different systems, otherwise you cannot log in to mysql and change the initial password.
Here's how to find the initial random password using Centos 7 as an example.
On versions earlier than Mysql 5.7.6, Mysql initializes the database with the mysql_install_db command, which creates a .mysql _ secret file at the root of the user where Mysql is installed, which records the random password generated by initialization, and users can log in to Mysql and change the password using the password change.
For Mysql 5.7.6 and later versions of the 5.7series, Mysql uses the mysqld-- initialize or mysqld-- initialize-insecure command to initialize the database, which does not generate random passwords. However, the previous command is used by default when installing MySQL, which also generates a random password. The password change is saved in the log file of Mysql.
After installing Mysql on a Centos 7 system using the rpm command, the configuration file for mysql is / etc/my.cnf. Open this file, and you can see the configuration information for mysql's datadir and log files, as follows:
Datadir=/var/lib/mysql
Log-error=/var/log/mysqld.log
Open the / var/log/mysqld.log file and search for the string A temporary password is generated for root@localhost:, to find this random password, which is usually easier to see in the first few lines of the log file.
Log in to mysql with the random password found, and after logging in for the first time, mysql must change the default password, otherwise no other database operations can be performed, which reflects the increasing security of Mysql.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.