CentOS6.5 install MySQL5.1.73 Database

Source: Internet
Author: User

CentOS6.5 install MySQL5.1.73 Database

I. Description

This blog introduces how to install the MySQL database, start and stop the MySQL service, log on and exit MySQL, and configure and modify the password of the root user of the MySQL database.

Ii. Main Steps

1. Check whether the MySQL database is installed in the system.

Check whether the operating system has been installed in this operating system. It shows that there is only one mysql class library, and this database is not installed.

[Tong @ tong tongSoftware] $ rpm-qa | grep mysql
Mysql-libs-5.1.73-3.el6_5.x86_64

2. To use yum to install the MySQL database, you must install the mysql client and the mysql-server Client.

[Tong @ tong tongSoftware] $ sudo yum install mysql-server
3. Check the installed database. The installed database is displayed.

[Tong @ tong tongSoftware] $ rpm-qa | grep mysql
Mysql-server-5.1.73-3.el6_5.x86_64
Mysql-5.1.73-3.el6_5.x86_64
Mysql-libs-5.1.73-3.el6_5.x86_64

4. Check the database startup status. If the database is not started, start the MySQL database.

[Tong @ tong tongSoftware] $ sudo service mysqld status
[Sudo] password for tong:
Mysqld is stopped
[Tong @ tong tongSoftware] $ sudo service mysqld start
Please report any problems with the/usr/bin/mysqlbug script!
[OK]
Starting mysqld: [OK]

5. No Password is used by default to log on to the database as the root user.

[Tong @ tong tongSoftware] $ mysql-u root
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 2
Server version: 5.1.73 Source distribution
Copyright (c) 2000,201 3, Oracle and/or its affiliates. All rights reserved ......

Mysql>

6. Enter exit to exit the database.

Mysql> exit
Bye

7. Configure the initial root Password

[Tong @ tong tongSoftware] $ sudo mysqladmin-u root passwordAdmin123

Format: mysqladmin-u User password

8. the root user uses the password to log on to the database.

[Tong @ tong tongSoftware] $ sudo mysql-u root-p
Enter password:
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 6
Server version: 5.1.73 Source distribution

9. Change the User Password

[Tong @ tong tongSoftware] $ sudo mysqladmin-u root-p passwordAdmin

Enter password:

Format: mysqladmin-u user-p password

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.