Install the MySQL database offline using the RPM Package in CentOS

Source: Internet
Author: User

I have been using Ubuntu for a long time and used to install it online. In centos, use rmp package to install it first, and record the following steps:

1. Check and uninstall MySQL installed on the local machine

Rpm-qa | grep-I mysql
Check results:

Mysql-5.1.66-2.el6_3.x86_64
Mysql-libs-5.1.66-2.el6_3.x86_64
Mysql-devel-5.1.66-2.el6_3.x86_64
It indicates that MySQL has been installed in the system and is uninstalled:

Rpm-e -- nodeps mysql-devel-5.1.66-2.el6_3.x86_64
Rpm-e -- nodeps mysql-5.1.66-2.el6_3.x86_64
Rpm-e -- nodeps mysql-libs-5.1.66-2.el6_3.x86_64
After force uninstallation, check whether there are any residual files:

Find/-name mysql
If yes:

Rm-rf/var/lib/mysql /*
2. Install MySQL
Upload and install the downloaded RPM Package. First, install the server.

Rpm-ivh MySQL-server-5.5.44-1.el6.x86_64.rpm
Then install the client:

Rpm-ivh MySQL-client-5.5.44-1.el6.x86_64.rpm
Start the MySQL service after installation.

Service mysql restart
Change the default password:

/Usr/bin/mysqladmin-u root password 'new password'
Use mysql-uroot-p to test whether MySQL can be logged on normally.
3. Configure MySQL
MySQL installed using the official RPM Package cannot find the my. cnf file. After the official installation, the configuration file directory is:

/Usr/share/mysql/my-medium.cnf.
Copy to etc and rename it:

Cp/usr/share/mysql/my-medium.cnf/etc/my. cnf
Then you can edit my. cnf.
4. Problem solving
Error description:

Starting MySQL... The server quit without updating PID file (/var/lib/mysql/myname. pid). [failed]
In this case, first try to disable the selinux service.

Vi/etc/selinux/config
Change SELINUX = enforcing to SELINUX = disabled.
Save and restart the server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.