Home  >  Article  >  Database  >  centos6.5 mysql installation

centos6.5 mysql installation

王林
王林Original
2023-05-08 20:13:05872browse

CentOS6.5 is an old version of the operating system, but it is still used by many users due to its stability and reliability. In this article, we will explore how to install MySQL database in CentOS 6.5.

  1. Download the MySQL installation package

First, you need to download the corresponding installation package from the MySQL official website. It is recommended to download the RPM-based installation package, which is designed for the CentOS operating system. You can use the following command to download:

wget https://dev.mysql.com/get/mysql57-community-release-el6-11.noarch.rpm

Note that this command will download the MySQL 5.7 version installation package. If you need other versions of MySQL, please find the corresponding installation package on the MySQL official website.

  1. Install MySQL

After the download is complete, you can use the following command to install MySQL in CentOS6.5:

rpm -ivh mysql57-community-release-el6-11.noarch.rpm
yum update
yum install mysql-server
  1. Start the MySQL service

After the installation is complete, you can use the following command to start the MySQL service:

service mysqld start

If an error occurs, you can use the following command to view the error message:

tail -f /var/log/mysqld.log

Usually, the error will Something to do with file permissions or port numbers.

  1. Set MySQL root user password

By default, the MySQL root user does not have a password set, so a password needs to be set to ensure security. A password can be set using the following command:

mysql_secure_installation

This command will prompt you for your password and guide you through additional security settings.

  1. Using MySQL

After installing and configuring MySQL, you can log in to MySQL using the following command:

mysql -u root -p

After entering the MySQL root user password set previously , you can log in to MySQL.

  1. Conclusion

Installing MySQL on CentOS6.5 is not complicated, just follow the above steps to complete. If an error occurs, please check the error message carefully and fix it accordingly. Unlike other operating systems, CentOS 6.5 may require more manual configuration to make MySQL run properly.

The above is the detailed content of centos6.5 mysql installation. 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