


Detailed process of installing, configuring and uninstalling mysql using rpm package._PHP tutorial
Jul 13, 2016 pm 05:08 PMDetailed 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

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP's big data structure processing skills

How to optimize MySQL query performance in PHP?

How to use MySQL backup and restore in PHP?

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

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 use MySQL stored procedures in PHP?

How to create a MySQL table using PHP?
