Installing, configuring, and dismounting MySQL using the RPM package

Source: Internet
Author: User

Detailed procedures for installing, configuring, and uninstalling MySQL via RPM packages.

Take mysql-server-4.0.14-0.i386.rpm as an example and put it in the/USR/SRC directory

Cd/usr/src

RPM-IVH mysql-server-4.0.14-0.i386.rpm

After the 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 a sample configuration file as a configuration file for MySQL:

Cp/usr/share/mysql/my-medium.cnf/etc/my.cnf

When the RPM package is installed, MySQL is automatically installed as a system service, so you can start and stop MySQL using the following command

Start MySQL

/etc/init.d/mysql start or service MySQL start

Stop MySQL

/etc/init.d/mysql stop or service MySQL stop

To this, the MySQL service is complete on the installation configuration.

Installing the MySQL Client

RPM-IVH mysql-client-4.0.14-0.i386.rpm

MySQL is installed after the directory structure is as follows:

The utility program is---ls/usr/bin/mysql* in the/usr/bin directory

Server program/usr/sbin/mysqld

Data Catalog/var/lib/mysql

By default, MySQL writes error log files, binary log files, and process files in the/var/lib/mysql directory, such as Localhost.err, Localhost.pid, localhost-bin.001, and so on.

To change these conditions, you can modify the/etc/my.cnf file

If you write the 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 a MySQL database (MySQL authorization table and other information) and test database (empty library), If you accidentally delete the/var/log/mysql directory, you can initialize it by using the program.

Uninstall MySQL

Rpm-qa|grep-i MySQL

Rpm-ev mysql-server-4.0.14-0 mysql-client-4.0.14-0

Data and/ETC/MY.CNF in/var/lib/mysql will not be removed after uninstallation, and will be removed manually if determined to be useless.

Rm-f/etc/my.cnf

Rm-rf/var/lib/mysql

Installing, configuring, and dismounting MySQL using the RPM package

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.