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