Through rpm Package installation, configuration and uninstall mysql detailed process. take the MySQL-server-4.0.14-0.i386.rpm as an example, put in the data directory after the cddatarpm-ivhMySQL-server-4.0.14-0.i386.rpm installation is complete in the usrsharemysql directory will have a mysql start mysql uninstall mysql installation
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, that is, to create the/var/log/mysql directory and to create the 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.
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