Step 2. Install mysql in yum
[Root @ stonex ~] # Yum-y install mysql-server
Installation result:
Installed:
Mysql-server.x86_64. 1.73-3. el6_5
Dependency Installed:
Mysql. x86_64. 1.73-3. el6_5 perl-DBD-MySQL.x86_64. 013-3.el6 perl-DBI.x86_64. 609-4.el6
Step 2. Set startup
[Root @ stonex ~] # Chkconfig mysqld on
Step 2. Start the MySql Service
[Root @ stonex ~] # Service mysqld start
Step 2: Set the password for the root user of MySQL
[Root @ stonex ~] # Mysql-u root
Welcome to the MySQL monitor. Commands end with; or \ g.
Some rows are omitted.
Mysql> select user, host, password from mysql. user;
The query password is empty. Use the following command to set the root password to root.
Mysql> set password for root @ localhost = password ('root ');
Mysql> exit
Step 2. log in with a new password
[Root @ stonex ~] # Mysql-u root-p
Step 2: Basic commands
Show databases; // view the existing database of the system
Use databasesname; // select the database to use
Drop database databasename; // Delete the selected database
Exit // exit the database connection
Create database test01; // create a database named test
Show tables; // list the tables in the current database
Use standard SQL for other basic addition, deletion, modification, and query
(End)