Home Backend Development PHP Tutorial Detailed process of installing, configuring and uninstalling mysql using rpm package._PHP tutorial

Detailed process of installing, configuring and uninstalling mysql using rpm package._PHP tutorial

Jul 13, 2016 pm 05:08 PM
mysql rpm use Bag uninstall Install of detailed process Configuration

Detailed process of using rpm package to install, configure and uninstall mysql tutorial.


Detailed process of installing, configuring and uninstalling mysql through rpm package.


Take MySQL-server-4.0.14-0.i386.rpm as an example and place it in the /data directory


cd /data


rpm -ivh MySQL-server-4.0.14-0.i386.rpm


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


Copy a sample 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, so you can use the following commands to start and 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 installation and configuration of the mysql service is complete.


Install 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 error log files, binary log files and process files in the /var/lib/mysql directory, such as localhost.err, localhost.pid, localhost-bin.001, etc.


To change these situations, 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 program /usr/bin/mysql_install_db, which can be used to initialize the mysql database tutorial, that is, create the /var/log/mysql directory, and create the mysql database (mysql authorization table and other information) and the test database (empty database). If you accidentally delete the /var/log/mysql directory, you can initialize it through this program.


Uninstall mysql


rpm -qa|grep -i mysql


rpm -ev MySQL-server-4.0.14-0 MySQL-client-4.0.14-0


After uninstallation, the data in /var/lib/mysql and /etc/my.cnf will not be deleted. If it is determined to be useless, delete it manually


rm -f /etc/my.cnf


rm -rf /var/lib/mysql

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629839.htmlTechArticleDetailed process of installing, configuring and uninstalling mysql tutorial using rpm package. Installing, configuring and uninstalling mysql through rpm package Detailed process. Take MySQL-server-4.0.14-0.i386.rpm as an example, place it in the /data directory...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP's big data structure processing skills PHP's big data structure processing skills May 08, 2024 am 10:24 AM

PHP's big data structure processing skills

How to optimize MySQL query performance in PHP? How to optimize MySQL query performance in PHP? Jun 03, 2024 pm 08:11 PM

How to optimize MySQL query performance in PHP?

How to use MySQL backup and restore in PHP? How to use MySQL backup and restore in PHP? Jun 03, 2024 pm 12:19 PM

How to use MySQL backup and restore in PHP?

What are the application scenarios of Java enumeration types in databases? What are the application scenarios of Java enumeration types in databases? May 05, 2024 am 09:06 AM

What are the application scenarios of Java enumeration types in databases?

How to insert data into a MySQL table using PHP? How to insert data into a MySQL table using PHP? Jun 02, 2024 pm 02:26 PM

How to insert data into a MySQL table using PHP?

How to fix mysql_native_password not loaded errors on MySQL 8.4 How to fix mysql_native_password not loaded errors on MySQL 8.4 Dec 09, 2024 am 11:42 AM

How to fix mysql_native_password not loaded errors on MySQL 8.4

How to use MySQL stored procedures in PHP? How to use MySQL stored procedures in PHP? Jun 02, 2024 pm 02:13 PM

How to use MySQL stored procedures in PHP?

How to create a MySQL table using PHP? How to create a MySQL table using PHP? Jun 04, 2024 pm 01:57 PM

How to create a MySQL table using PHP?

See all articles