mysql installation -yum way

1. Environmental
view the current system environment, using centos release 6.5 (Final).

2. Check whether the current system already installed mysql

rpm -qa | grep mysql

3. If so, delete data installed

rpm -e --nodeps mysql-libs-5.1.71-1.el6.i686

Which is a powerful command rpm -e --nodeps delete mode, even if there are other files rely on, you can still delete strong.
Check again, they found none.

4. Next, the installation is started by yum Mysql.
First, you can view the version available on the yum can be downloaded:

yum list | grep mysql

You can see mysql, mysql-server and mysql-devel, then install them:

yum install -y mysql-server mysql mysql-devel

When shown below occurs, the setup is successful it!

You can view information about the installed version of mysql

rpm -qi mysql-server

5. After a successful installation starts automatically initialized when you first start

service mysqld start

After initialization, check the running status of mysql:

6. simple configuration
settings in mysql root password
, for example, setting the password is 123456

mysqladmin -u root password '123456'

7. Log

mysql -u root -p

After Qiaoxia Enter, enter the password, 123456, hit ENTER again, you can see the words Welcome and so on, it means that the login is successful it! ! !

Can be seen in front of the command line into a
mysql>
This indicates that the current is in the mysql service,

8. Quit
using the command
exit;
you can, remember, mysql command at the end to add a semicolon;

Guess you like

Origin www.cnblogs.com/anboy/p/11456950.html