Detailed process of installing, configuring, and uninstalling mysql using rpm Package. _ PHP Tutorial

Source: Internet
Author: User
Tags mysql tutorial
Detailed process of installing, configuring, and detaching mysql using rpm packages .. Detailed procedures for installing, configuring, and uninstalling mysql using rpm packages. detailed process of installing, configuring, and detaching mysql through rpm packages. take the MySQL-server-4.0.14-0.i386.rpm as an example, put in the data Directory using rpm Package installation, configuration and uninstall mysql tutorial detailed process.


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/data Directory


Cd/data


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 tutorial, that is, to create the/var/log/mysql directory, and create 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 it.


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

Detailed procedures 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/data Directory...

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.