Home  >  Article  >  Database  >  How to quickly deploy a MySQL database server

How to quickly deploy a MySQL database server

PHPz
PHPzforward
2023-06-03 09:11:54795browse

MySQL is a relational database management system developed by the Swedish MySQL AB company and is currently a product of Oracle. MySQL is one of the most popular relational database management systems. In terms of WEB applications, MySQL is the best RDBMS (Relational Database Management System) application software.

How to quickly deploy a MySQL database server

Installing a complete MySQL database requires the following RPM package files:

  1. perl-DBI- 1.609-4.e16.i686.rpm: Perl language data API

  2. perl-DBD-MySQL-4.013-3.e16.i686.rpm: MySQL and Perl language interface program Package

  3. mysql-5.1.61-4.e16.i686.rpm:MySQL database client program

  4. mysql-connector-odbc- 5.1.5r1144-7.e16.i686.rpm:Connector between MySQL database and ODBC

  5. mysql-server-5.1.61-4.e16.i686.rpm:mysql database server Program

After copying the above files to the current directory, execute the following commands in order to install:

# rpm -ivh perl-DBI-1.609-4.e16.i686.rpm# rpm -ivh perl-DBD-MySQL-4.013-3.e16.i686.rpm# rpm -ivh mysql-5.1.61-4.e16.i686.rpm# rpm -ivh mysql-connector-odbc-5.1.5r1144-7.e16.i686.rpm# rpm -ivh mysql-server-5.1.61-4.e16.i686.rpm

After the installation is successful, the relevant Several important files of the MySQL server software are distributed as follows:

  1. ##/etc/rc.d/init.d/mysqld: MySQL server startup script

  2. /usr/bin/mysqlshow: Display database, table and column information

  3. /usr/libexec/mysqld: Server process program file

  4. /usr/libexec/mysqlmanager: Instance management program file

  5. /usr/share/doc/: Directory for storing description files

  6. /usr/share/man/man 1/……: Directory where manual pages are stored

  7. /var/lib/mysql/: Server database file storage directory

  8. /var/log/mysqld.log: The log file of the MySQL server

In order to run mysql, you can enter the following command:

# /etc/rc.d/init.d/mysqld start

Then enter the following command to check whether the process is started:

#ps -eaf | grep mysqld

When the process is started, you can use the following command to check the mysqld default Check whether the listening port has been opened:

# 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 open. In order to ensure that clients on the network can access the MySQL server, you can enter the following command to open this 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, in order to ensure that the server has started normally, you can enter the following command to check:

# mysqladmin version

When the version details appear, it means that the MySQL server is running normally.

The above is the detailed content of How to quickly deploy a MySQL database server. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete