MySQL Database Server SETUP
GuideMySQL database is the most widely used database system in Linux. It can be easily integrated with other servers, such as Apache, Vsftpd, and Postfix. The following describes how to install the MySQL database server on RHEL 6.
Install the complete MySQL database requires the following RPM package files:
- Perl-DBI-1.609-4.e16.i686.rpm: Perl-language data APIs
- Perl-DBD-MySQL-4.013-3.e16.i686.rpm: interface packages for MySQL and Perl
- Mysql-5.1.61-4.e16.i686.rpm: MySQL database Client
- Mysql-connector-odbc-5.1.5r1144-7.e16.i686.rpm: connector between MySQL database and ODBC
- Mysql-server-5.1.61-4.e16.i686.rpm: mysql database server program
Copy the preceding files to the current directory and run the following commands to install the files:
# rpm -ivhperl-DBI-1.609-4.e16.i686.rpm# rpm -ivhperl-DBD-MySQL-4.013-3.e16.i686.rpm# rpm -ivhmysql-5.1.61-4.e16.i686.rpm# rpm -ivhmysql-connector-odbc-5.1.5r1144-7.e16.i686.rpm# rpm -ivhmysql-server-5.1.61-4.e16.i686.rpm
After the installation is successful, several important files about the MySQL server software are distributed as follows:
- /Etc/rc. d/init. d/mysqld: MySQL server startup script
- /Usr/bin/mysqlshow: displays information about databases, tables, and columns.
- /Usr/libexec/mysqld: process program file of the server
- /Usr/libexec/mysqlmanager: instance management program file
- /Usr/share/doc/: directory for storing description files
- /Usr/share/man 1 /...
- /Var/lib/mysql/: Server database file storage directory
- /Var/log/mysqld. log: log file of the MySQL server
To run mysql, enter the following command:
# /etc/rc.d/init.d/mysqld start
Enter the following command to check whether the process is started:
#ps -eaf | grep mysqld
After the process starts, run the following command to check whether the default listening port of mysqld is Enabled:
# netstat -anlp | grep 3306tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1121/mysqld
It can be seen that port 3306 is already on. To ensure that clients on the network can access the MySQL server, run the following command to open the port:
# iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
After the above process is completed, you can connect to the MySQL server through the client.Finally, to ensure that the server is started properly, run the following command:
# mysqladmin version
When the version details appear, it indicates that the MySQL server is running properly.
Original address: http://www.linuxprobe.com/mysql-database-server-set-up/