Detailed procedures for installing, configuring, and uninstalling MySQL via RPM packages.
Take mysql-server-4.0.14-0.i386.rpm as an example and put it in the/USR/SRC directory
Cd/usr/src
RPM-IVH mysql-server-4.0.14-0.i386.rpm
After the 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 a sample configuration file as a configuration file for MySQL:
Cp/usr/share/mysql/my-medium.cnf/etc/my.cnf
When the RPM package is installed, MySQL is automatically installed as a system service, so you can start and stop MySQL using the following command
Start MySQL
/etc/init.d/mysql start or service MySQL start
Stop MySQL
/etc/init.d/mysql stop or service MySQL stop
To this, the MySQL service is complete on the installation configuration.
Installing the MySQL Client
RPM-IVH mysql-client-4.0.14-0.i386.rpm
MySQL is installed after the directory structure is as follows:
The utility program is---ls/usr/bin/mysql* in the/usr/bin directory
Server program/usr/sbin/mysqld
Data Catalog/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, and so on.
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:
[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, that is to create the/var/log/mysql directory, and to create a MySQL database (MySQL authorization table and other information) and test database (empty library), If you accidentally delete the/var/log/mysql directory, you can initialize it by using the program.
Uninstall MySQL
Rpm-qa|grep-i MySQL
Rpm-ev mysql-server-4.0.14-0 mysql-client-4.0.14-0
Data and/ETC/MY.CNF in/var/lib/mysql will not be removed after uninstallation, and will be removed manually if determined to be useless.
Rm-f/etc/my.cnf
Rm-rf/var/lib/mysql
Installing, configuring, and dismounting MySQL using the RPM package