Home >Database >Mysql Tutorial >How to install mysql using yum command

How to install mysql using yum command

王林
王林Original
2020-09-01 14:33:4914481browse

Yum command to install mysql: directly execute the [yum -y install mysql-server mysql mysql-devel] command; after the installation is completed, you can execute the [service mysqld start] command to start mysql.

How to install mysql using yum command

Purpose:

Use the yum command to install the mysql database.

Environment: centos6.4 system

(Recommended tutorial: mysql video tutorial)

Specific method:

1. View Check whether the mysql that comes with the system has been installed. Execute the command:

yum list installed | grep mysql

2. If it has been installed, uninstall it. Use the command:

yum -y remove mysql-libs.x86_64

3. Check the version information of mysql on the yum library, command :

yum list | grep mysql 或 yum -y list mysql*

4. Use yum to install the mysql database, use the command:

yum -y install mysql-server mysql mysql-devel

5. View the mysql version information, the command:

rpm -qi mysql-server

(Related tutorial recommendations: mysql tutorial)

6. Start mysql and execute the command:

service mysqld start

If you need to start it, execute the command:

chkconfig mysqld on

7. Database security configuration wizard, execute Command:

mysql_secure_installation

Just follow the prompts step by step.

8. Log in to mysql. The login password is set during security configuration. Execute the command:

mysql -uroot -p

The above is the detailed content of How to install mysql using yum command. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn