Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set the MySQL initial root password for a newly installed RHEL AS

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how to set the initial MySQL root password for the newly installed RHEL AS". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to set the initial MySQL root password for the newly installed RHEL AS".

1. We installed the MySQL database by default when we installed the RHEL AS system. Under this installation method, the initial password for the database's highest account, root, is empty.

As some customers do not have a strong sense of security, they directly enable the database after receiving the system, leaving hidden dangers.

Therefore, the technical department is required to set the initial password of the MySQL database after dealing with the installation of the RHEL AS system.

The methods are as follows:

After the system is installed, log in to the system, use the SETUP program, modify the default service items of the system, open the mysqld service, and restart the server.

Or / etc/init.d/mysqld start, turn on the mysql service temporarily.

Enter the command: / usr/bin/mysqladmin-u root-p password * (the new password, which is clearly shown here, requires the same setting rules as the system login password). Enter will prompt enter password after you enter. Here, you are required to enter the original password, because the initial password is empty, so you can enter directly.

Verify:

1. Enter mysql-u root-p under any path, enter, prompt for password, enter the set new password and enter the database manager.

Use exit or quit to exit from the database manager to the system.

two。 Modify config.inc. File

3. In the Mysql environment, you can set the password using the following statement: (untested)

A.insert into user (host,user,password) values (%, user_name,password ("your password")

B.set password for user_name = password ("your password")

Both of the above methods must overload the authorization table.

c. Of course, you can also set the password directly when you create a user, and the grant statement will automatically encrypt the password for you.

Such as

Grant all on *. * to identified by "your password"

In addition, you can also use the admin program to set the password in the shell environment

Such as

Mysqladmin-u root password "your password"

Thank you for reading, the above is the content of "how to set the initial MySQL root password for the newly installed RHEL AS". After the study of this article, I believe you have a deeper understanding of how to set the initial MySQL root password for the newly installed RHEL AS, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report