First, describe
This blog mainly introduces CentOS6.5 installation MySQL database , startup and shutdown MySQL service, MySQL login and exit, as well asthe password configuration and modification of my SQL database root user.
Ii. Main steps
1. Check if the system has MySQL database installed
First check if the operating system has an operating system installed, display only one MySQL class library, and do not install the database.
[Email protected] tongsoftware]$ Rpm-qa | grep MySQL
Mysql-libs-5.1.73-3.el6_5.x86_64
2. Installing the MySQL database with Yum requires the installation of MySQL client and mysql-server terminal
[[email protected] tongsoftware]$ sudo yum install MySQL Mysql-server
3. View the installed database and display the completed database
[Email protected] 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 startup status of the database and start the MySQL database if it is not started
[[email protected] tongsoftware]$ sudo service mysqld status
[sudo] password for tong:
Mysqld is stopped
[[email protected] tongsoftware]$ sudo service mysqld start
Problems with The/usr/bin/mysqlbug script!
[OK]
Starting mysqld: [OK]
5. Default no password to log in to the database as the root user
[Email protected] 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) and/or, Oracle, its affiliates. All rights reserved...
Mysql>
6. Enter exit to exit the database
Mysql> exit
Bye
7. Configure the initial root password
[email protected] tongsoftware]$ sudo mysqladmin-u root password Admin123
format; mysqladmin-u User password Password
8. The root user logs into the database with a password
[email protected] 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. Modify User Password
[email protected] tongsoftware]$ sudo mysqladmin-u root-p password Admin
Enter Password:
Format: mysqladmin-u user-p password password
CentOS6.5 Installing the MySQL5.1.73 database