Configure MySQL and uninstall MySQL instances

Source: Internet
Author: User
Tags php and mysql

The following Article It mainly describes how to correctly install MySQL through the RPM package and configure and uninstall MySQL. The following describes how to configure MySQL and uninstall MySQL (the best combination with PHP) detailed operation process, hope to bring you some help in this regard.

Take MySQL (the best combination with PHP)-server-4.0.14-0.i386.rpm as an example,

Put it in the/Data DirectoryCopyCodeThe Code is as follows: CD/Data
Rpm-IVH MySQL (best combination with PHP)-server-4.0.14-0.i386.rpm

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

Copy an example configuration MySQL file as the configuration file for MySQL (the best combination with PHP:Copy codeThe Code is as follows: CP/usr/share/MySQL (best combination with PHP)/my-medium.cnf/etc/My. CNF

After the RPM package is installed, MySQL (the best combination with PHP) is automatically installed as a system service. Therefore, you can use the following command to start and stop MySQL (the best combination with PHP)

Start MySQL (the best combination with PHP)

/Etc/init. d/MySQL (the best combination with PHP) Start or service MySQL (the best combination with PHP) Start

Stop MySQL (the best combination with PHP)

/Etc/init. d/MySQL (the best combination with PHP) Stop or service MySQL (the best combination with PHP) Stop

By now, MySQL (the best combination of PHP and MySQL) is installed and configured.

Install the MySQL (best combination with PHP) ClientCopy codeThe Code is as follows: rpm-IVH MySQL (best combination with PHP)-client-4.0.14-0.i386.rpm

After installing MySQL (the best combination with PHP), the directory structure is as follows:

ToolsProgramIn the/usr/bin directory --- ls/usr/bin/MySQL (the 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 with PHP) writes error log files, binary log files, and process files in/var/lib/MySQL (the best combination with PHP) 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:

[MySQL (best combination with PHP) d_safe]

Err-log =/var/log/MySQL (the best combination with PHP) D. Log

There is a utility/usr/bin/MySQL (the best combination with PHP) _ install_db, which can be used to initialize the MySQL (the best combination with PHP) database, create the/var/log/MySQL directory (the best combination with PHP) and create the MySQL database (the best combination with PHP) (the best combination of MySQL and PHP) authorization Table and other information) and test database (empty database), If you accidentally delete the/var/log/MySQL (the best combination with PHP) directory, you can use this program to initialize.

Uninstall MySQL (the best combination with PHP)Copy codeThe Code is as follows: rpm-Qa | grep-I MySQL (the best combination with PHP)
Rpm-ev MySQL (best combination with PHP)-server-4.0.14-0 MySQL (best combination with PHP)-client-4.0.14-0

After uninstallation, data in/var/lib/MySQL (the best combination with PHP) and/etc/My. CNF will not be deleted. If it is determined that it is useless, it will be manually deleted.Copy codeThe Code is as follows: Rm-F/etc/My. CNF
Rm-RF/var/lib/MySQL (best combination with PHP)

The above content introduces how to configure and uninstall 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.