Install, configure, and disassemble MySQL using an RPM package

Source: Internet
Author: User

The new project was launched. It was a hosted call center and analyzed the business processes of competitors. It was probably developed based on Asterisk. A while ago, we saw an open-source project astercrm, some

The call center and CRM functions, so a new environment analysis has been built, and RedHat 4 has been installed yesterday. Next I need to install MYSQL:

Detailed process of installing, configuring, and detaching MySQL through RPM packages.

Take MySQL-server-4.0.14-0.i386.rpm as an example, put it under the/usr/src directory

CD/usr/src

Rpm-IVH MySQL-server-4.0.14-0.i386.rpm

After installation is complete, there will be a MySQL STARTUP script in the/usr/share/MySQL directory mysql. server and sample configuration files (such as my-huge.cnf, my-large.cnf, my-medium.cnf)

Copy an example configuration file as the MySQL configuration file:

CP/usr/share/MySQL/my-medium.cnf/etc/My. CNF

After the RPM package is installed, MySQL is automatically installed as a system service. Therefore, you can run the following command to start or stop MYSQL:

Start MySQL

/Etc/init. d/MySQL start or service MySQL start

Stop MySQL

/Etc/init. d/MySQL stop or service MySQL stop

At this point, the MySQL service has been installed and configured.

Install the mysql client

Rpm-IVH MySQL-client-4.0.14-0.i386.rpm

After MySQL is installed, the directory structure is as follows:

The tool program is in the/usr/bin directory --- ls/usr/bin/MySQL *

Server program/usr/sbin/mysqld

Data directory/var/lib/MySQL

By default, MySQL writes the Error Log File, binary log file and process file in the/var/lib/MySQL directory, such as localhost. Err, localhost. PID, localhost-bin.001, etc.

To change these conditions, modify the/etc/My. CNF file.

For example, to write a log file in the/var/log directory, you can add the following two lines to the my. CNF file:

[Mysqld_safe]

Err-log =/var/log/mysqld. Log

There is a utility/usr/bin/mysql_install_db which can be used to initialize the MySQL database, that is, to create the/var/log/MySQL directory and to create the MySQL database (MySQL authorization table and other information) and Test Database (empty database), If you accidentally delete the/var/log/MySQL directory, you can use this program to initialize.

Uninstall MySQL

Rpm-Qa | grep-I MySQL

Rpm-ev MySQL-server-4.0.14-0 MySQL-client-4.0.14-0

Data in/var/lib/MySQL and/etc/My. CNF will not be deleted after uninstallation. If it is determined that it is useless, it will be deleted manually.

Rm-F/etc/My. CNF

Rm-RF/var/lib/MySQL

Related Article

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.