Install MySQL database in rpm mode on RHEL6 Platform

Source: Internet
Author: User
Mysql is a platform-independent open-source database that can be built on Windows, Linux, Unix, and other platforms. This article mainly explains how to install Mysql databases on the Linux platform.

Mysql is a platform-independent open-source database that can be built on Windows, Linux, Unix, and other platforms. This article mainly explains how to install Mysql databases on the Linux platform.

1. Mysql Database Installation Introduction:

Mysql is a platform-independent open-source database that can be built on Windows, Linux, Unix, and other platforms. This article mainly explains how to install Mysql databases on the Linux platform, however, the software installed on the Linux platform is divided into rpm version installation and source code installation. This article describes how to install and deploy the Mysql database on the RHEL6 platform by using the rpm package installation method.

2. Install and deploy the Mysql database

Mysql Data is a C/S access mode. The data packets used by mysql are divided into Server and Client packages. mysql-server is a Server package and Mysql-client is a Client package, you can install these rpm packages in either of the following ways:

1. Use rpm to directly use the rpm-ivh mysql-server-version command for installation.

2. The installation method using yum rpm has package dependencies, which is inconvenient to install. yum can solve the dependency problem between rpm packages.

First: Install with rpm

Procedure:

1. mount the disc to the system (the name of the disc is/dev/hdc in rhel5 and/dev/cd0 in rhel6. You can directly mount the disc in/dev/cdrom Mode)

[Root @ station254 ~] # Mount-o loop/var/ftp/iso/rhel-server-6.2-x86_64-dvd.iso/mnt/cdrom/mounting in iso Mode

[Root @ station254 ~] # Df/mnt/cdrom/view the mounting information and mount it to/mnt/cdrom
File System 1 K-block used available % mount point
/Var/ftp/iso/rhel-server-6.2-x86_64-dvd.iso.
3505504 3505504 0 100%/mnt/cdrom

2. Use rpm-ivh for installation (most of the packages in rhel5 are in the Server directory, while those in rhel6 are in the Pakages directory)

[Root @ station254 ~] # Rpm-ivh/mnt/cdrom/Packages/mysql-server-5.1.52-1.el6_0.1.x86_64.rpm Server Software Package
Preparing... ######################################## ### [100%]
1: mysql-server ##################################### ###### [100%]

[Root @ station254 ~] # Rpm-ivh/mnt/cdrom/Packages/mysql-5.1.52-1.el6_0.1.x86_64.rpm client package
Preparing... ######################################## ### [100%]
Package mysql-5.1.52-1.el6_0.1.x86_64 is already installed

Note: When you use the rpm command to install the software package, you need to enter the directory mounted to the CD; otherwise, you need to write the complete path and use the ivh parameter, where I indicates install is the installation, v indicates verbose indicates the installation process, and h indicates hash indicates the progress bar of the installation process. At the same time, it should be noted that the rpm package installation method has a link between the package and the package. Note that the yum installation method is recommended.

Method 2: Install using yum

Yum is a software package installation method that solves the rpm package dependency relationship. Its principle is to retain the dependency between each rpm package as a database file through some tools, when the client installs the software, it reads the dependent file to know which additional rpm packages need to be installed during installation, and then downloads the corresponding rpm packages from the yum server and installs them, so as to achieve an intelligent installation, similar to automatic installation in windows.

Yum can be divided into network yum sources or LAN yum sources. The Internet yum source can be used for everyone to use the yum repository over the Internet, redHat provides dedicated yum warehouses, but charges are required. Currently, CentOS provides free yum sources. Some well-known websites in China, such as 163 and the Chinese Emy of sciences, provide yum warehouses, you can use it directly (for more information, see the yum chapter). This article uses the configuration table local yum as an example to build a local yum source.

The configuration steps are as follows:

1. Attach the disc to the specified position (it is recommended to write/etc/fstab to take effect permanently)
[Root @ station254 ~] # Vim/etc/fstab
/Var/ftp/iso/rhel-server-6.2-x86_64-dvd.iso/mnt/cdrom iso9660 ults, loop 0 0

[Root @ station254 ~] # Mount-a load mounting option, simulate the boot process, and prevent/etc/fstab file writing errors

[Root @ station254 ~] # Df/mnt/cdrom/view mounting information
Filesystem 1K-blocks Used Available Use % Mounted on
/Var/ftp/iso/rhel-server-6.2-x86_64-dvd.iso.
3505504 3505504 0 100%/mnt/cdrom

2. The default CD is a yum source. Because Redhat has saved the dependency file between rpm packages in the database file, you can directly configure the client.

[Root @ station254 ~] # Vim/etc/yum. repos. d/station254.repo client configuration file, as long as it ends with. repo, the name can be any

[Base] repository name. It can be any one of them. It can be unique. It is the path of the basic repository and most software packages.
Name = Red Hat Enterprise Linux 6.2 Server description, any written
Baseurl = file: // mnt/cdrom/Server path. The url format must be used. The local format is file: //.
Enabled = 1 indicates whether to enable or disable the service. 1 indicates enable and 0 indicates disabled.
Gpgcheck = 1 whether to use the GPG public key verification. We recommend that you enable
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release public KEY file path

[HighAvailability] repository of high-tech software packages
Name = Red Hat Enterprise Linux 6.2 HighAvailability
Baseurl = file: // mnt/cdrom/HighAvailability
Enabled = 1
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[LoadBalancer] repository where the Server Load balancer package is located
Name = Red Hat Enterprise Linux 6.2 LoadBalancer
Baseurl = file: // mnt/cdrom/LoadBalancer
Enabled = 1
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

3. Install the mysql database software package (you can install it by using the software package name and software package group)

1. install the software package:
[Root @ station254 ~] # Yum-y install mysql-server mysql


2. install the software package:
[Root @ station254 ~] # Yum-y groupinstall "MySQL Database server" "MySQL Database client"


3. Mysql package structure:

View the Package Structure of mysql-server:
[Root @ station254 ~] # Rpm-ql mysql-server
/Etc/rc. d/init. d/mysqld service control script
/Usr/bin/innochecksum mysql Server Tool
/Usr/bin/myisam_ftdump
/Usr/bin/myisamchk
/Usr/bin/myisamlog
/Usr/bin/myisampack
/Usr/bin/mysql_convert_table_format
/Usr/bin/mysql_fix_extensions
/Usr/bin/mysql_fix_privilege_tables
/Usr/bin/mysql_install_db
/Usr/bin/mysql_secure_installation
/Usr/bin/mysql_setpermission
/Usr/bin/mysql_tzinfo_to_ SQL
/Usr/bin/mysql_upgrade
/Usr/bin/mysql_zap
/Usr/bin/mysqlbug
/Usr/bin/mysqld_multi
/Usr/bin/mysqld_safe
/Usr/bin/mysqldumpslow
/Usr/bin/mysqlhotcopy
/Usr/share/mysql/my-huge.cnf profile template
/Usr/share/mysql/my-innodb-heavy-4G.cnf.
/Usr/share/mysql/my-large.cnf.
/Usr/share/mysql/my-medium.cnf.
/Usr/share/mysql/my-small.cnf.
/Var/lib/mysql database storage path
/Var/log/mysqld. log file
/Var/run/mysqld process File

4. Start and manage the mysqld service:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.