Install MySQL using yum in Linux

Source: Internet
Author: User
Changed from MySQL to 5.0.45.
Check whether the installation package exists.
# Yum list MySQL
Install the mysql client
# Yum install MySQL
# Yum list mysql-Server
Install the MySQL server
# Yum install mysql-Server
After the installation, you need to start the MySQL service. You can use either of the following methods:
1. Service mysqld start
2./etc/init. d/mysqld start
After the startup, you need to create a root administrator for MySQL:
# Mysqladmin-u Root Password 123456
Then we can connect to MySQL through the following command line:
# Mysql-u root-P
Enter the password...

Today, I have nothing to do with php.org. I accidentally discovered the restoration method after the root password of the MySQL database is lost and did not dare to exclusive. I hope to help you.

1. End the currently running MySQL process.
# Killall mysqld

2. Run in MySQL security mode and skip permission verification.
#/Usr/bin/safe_mysqld -- skip-grant-tables

3. log on to MYSQL as the root user.
# Mysql-u Root

4. Modify the root user password.
Mysql>; use MySQL;
Mysql>; update user SET Password = PASSWORD ('pass') where user = 'root ';
Query OK, 2 rows affected (0.02 Sec)
Rows matched: 2 changed: 2 Warnings: 0
Mysql>; exit

5. End MySQL security mode and run MySql in normal mode.
# Killall mysqld
# Mysqld

6. Try your new password ...... Try again and again!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.