Configure MySQL and uninstall MySQL instance operations _mysql

Source: Internet
Author: User
Tags mysql in
The following article mainly describes how to correct the installation of the RPM package, MySQL configuration and uninstall, the following details on the configuration of MySQL and uninstall MySQL (and PHP with the best combination) of the detailed operation process, hoping to bring you some help in this respect.

Take the MySQL (and the best combination of PHP)-server-4.0.14-0.i386.rpm for example,

Put it in the/data directory.
Copy Code code as follows:

Cd/data
RPM-IVH MySQL (the best combination of PHP)-server-4.0.14-0.i386.rpm

After installation, the/usr/share/mysql (and PHP Best Mix) directory will have a MySQL (and PHP best combination) boot script mysql (and PHP with the best combination). Server and sample configuration files, etc. ( such as MY-HUGE.CNF, MY-LARGE.CNF, MY-MEDIUM.CNF)

Copy an example to configure a MySQL file as a configuration file for MySQL (the best combination of PHP):
Copy Code code as follows:

Cp/usr/share/mysql (best combination with PHP)/my-medium.cnf/etc/my.cnf

After installation of the RPM package automatically mysql (and PHP with the best combination) installed into system services, so you can use the following command to start, stop MySQL (and PHP with the best combination)

Start MySQL (best combination with PHP)

/etc/init.d/mysql (best combination with PHP) Start or service MySQL (the best combination of PHP) start

Stop MySQL (best combination with PHP)

/etc/init.d/mysql (best combination with PHP) stop or service MySQL (best combination with PHP) stop

To this end, MySQL (and PHP with the best combination) service on the installation configuration MySQL completed.

Install MySQL (best combination of PHP) client
Copy Code code as follows:

RPM-IVH MySQL (the best combination of PHP)-client-4.0.14-0.i386.rpm

MySQL (the best combination of PHP) after installation, the directory structure is as follows:

Tool---ls/usr/bin/mysql in/usr/bin directory (best combination with PHP) *

Server program/usr/sbin/mysql (best combination with PHP) d

Data Directory/var/lib/mysql (best combination with PHP)

By default, MySQL (the best combination of PHP) writes error log files, binary log files, and process files in the directory of/var/lib/mysql (the best combination of PHP), such as Localhost.err, Localhost.pid, LOCALHOST-BIN.001, etc.

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:

[MySQL (best combination with PHP) D_safe]

Err-log =/var/log/mysql (best combination with PHP) D.log

There is a utility/usr/bin/mysql (the best combination of PHP) _install_db, which can be used to initialize the MySQL (and PHP Best Mix) database, that is, create/var/log/mysql (the best combination of PHP) directory, and create MySQL (and PHP with the best combination) database (MySQL (with the best combination of PHP) and the authorization table information and test database (empty library), if accidentally deleted/var/log/mysql (and PHP match the best combination) The directory can be initialized by this program.

Uninstall MySQL (best combination with PHP)
Copy Code code as follows:

Rpm-qa|grep-i MySQL (best combination with PHP)
Rpm-ev MySQL (best combination with PHP)-server-4.0.14-0 MySQL (the best combination of PHP)-client-4.0.14-0

The data and/etc/my.cnf in/var/lib/mysql (the best combination of PHP) after uninstall will not be deleted, and if it is not done, delete it manually.
Copy Code code as follows:

Rm-f/etc/my.cnf
Rm-rf/var/lib/mysql (best combination with PHP)

The above related content is to configure and uninstall MySQL introduction, hope you can have some harvest.
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.