1th step, yum install MySQL
[Email protected] ~]# yum-y install Mysql-server
Installation Result:
Installed:
Mysql-server.x86_64 0:5.1.73-3.el6_5
Dependency installed:
mysql.x86_64 0:5.1.73-3.el6_5 perl-dbd-mysql.x86_64 0:4.013-3.el6 Perl-dbi.x86_64 0:1.609-4.el6
2nd step, set boot start
[Email protected] ~]# chkconfig mysqld on
3rd step, start the MySQL service
[[Email protected] ~]# service mysqld start
4th step, set the root user password for MySQL
[Email protected] ~]# mysql-u root
Welcome to the MySQL Monitor. Commands End With; or \g.
...... Some lines are omitted
Mysql> select User,host,password from Mysql.user;
To query the user's password, all empty, set the root password to root with the following command
mysql> Set password for [email protected]=password (' root ');
Mysql> exit
5th step, login with new password
[Email protected] ~]# mysql-u root-p
6th step, Basic command
show databases; To view a database that already exists on the system
Use Databasesname; Select the database you want to use
Drop database databasename; Delete the selected database
Exit//Disconnect from database
Create Database test01; To create a database named Test
Show tables; List the tables under the current database
Other basic additions and deletions using standard SQL
7th step, open telnet permission
GRANT all privileges on * * to ' root ' @ '% ' identified by ' root ' with GRANT OPTION;
FLUSH privileges;
Installation of MySQL under CENTOS6