Home >Database >Mysql Tutorial >centos6.5 mysql installation
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.
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.
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
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.
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.
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.
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!