MySQL installed on Linux one of the Yum installation

Source: Internet
Author: User
Tags gpg

MySQL installation is nothing more than the following, where Yum installation is also a RPM installation, but this does not need to download the installation package, directly according to the operating system comes with the MySQL package installed, relatively simple, this article mainly on Yum, followed by several other ways to summarize.

The current installation method

1,RPM Installation

2, binary installation

3, source installation

4,yum Installation

Yum mode installation

1. Install the operating system


1.1 Installing Red Hat Enterprise Linux 6.2 (64-bit)
Arch:x86_64
1.2. Turn off SELinux vi/etc/selinux/config

1.3. Service Iptables stop temporarily shutting down the firewall


2 Installing the database MySQL
2.1 Mount the Redhat image file ftp://192.168.0.212/pub/iso/rhel6.2/, the command is as follows
#mkdir-P/mnt/iso
#mkdir-P/mnt/redhat5.5
# Mount 192.168.0.212:/VAR/FTP/PUB/ISO/RHEL5.5//mnt/iso/
# mount-t Iso9660-o Loop rhel-server-5.5-x86_64-dvd.iso/mnt/redhat5.5/
2.2 Configuring Yum
# cd/etc/yum.repos.d/
# CP Rhel-debuginfo.repo Rhel-debuginfo.repo_bak
# VI Rhel-debuginfo.repo

[Rhel-debuginfo]
name=red Hat Enterprise Linux $releasever-$basearch-debug
Baseurl=file:///mnt/redhat5.5/server
Enabled=1
Gpgcheck=1
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-redhat-release





[[email protected] yum.repos.d]$ ls
El5u5.repo El5u8.repo Rhel-debuginfo.repo
[email protected] yum.repos.d]$ cat El5u8.repo
[Server]
name=red Hat Enterprise Linux 5 Update 8
Baseurl=ftp://192.168.0.212/pub/src/rhel5u8/x64/server
Enabled=1
Gpgcheck=1
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-redhat-release
[VT]
name=red Hat Enterprise Linux 5 Update 8
Baseurl=ftp://192.168.0.212/pub/src/rhel5u8/x64/vt
Enabled=1
Gpgcheck=1
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-redhat-release
[Cluster]
name=red Hat Enterprise Linux 5 Update 8
Baseurl=ftp://192.168.0.212/pub/src/rhel5u8/x64/cluster
Enabled=1
Gpgcheck=1
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-redhat-release
[Clusterstorage]
name=red Hat Enterprise Linux 5 Update 8
Baseurl=ftp://192.168.0.212/pub/src/rhel5u8/x64/clusterstorage
Enabled=1
Gpgcheck=1
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-redhat-release
2.3 Create a MySQL data store directory based on your needs
# Mkdir/mysqldata
2.4 Yum Installation Mysql,mysql-server
# yum Install MySQL Mysql-server
2.5 Modifying the MySQL configuration file
# VI/ETC/MY.CNF
[Mysqld]
Datadir=/data/mysql
Socket=/var/lib/mysql/mysql.sock
User=mysql
# Default to using old password format for compatibility with MySQL 3.x
# clients (those using the Mysqlclient10 compatibility package).
Old_passwords=1
Default-character-set=utf8

# Disabling Symbolic-links is recommended to prevent assorted security risks;
# to does so, uncomment the line:
# symbolic-links=0

Lower_case_table_names=1

[Mysqld_safe]
Log-error=/var/log/mysqld.log
Pid-file=/var/run/mysqld/mysqld.pid

[MySQL]
Default-character-set=utf8


2.6 start MySQL while adding MySQL auto-start
#/etc/rc.d/init.d/mysqld Start
# Chkconfig Mysqld on
# chkconfig--list mysqld

2.7 Modifying the MySQL password
# mysql-u Root
/usr/bin/mysqladmin-u Root Password 123456

Mysql> Grant all on mysql.* to ' root ' @ ' localhost ' identified by ' mysql8895 '
mysql> source/opt/mysql.sql Import data
Mysql> exit

To create a user:

Mysql> Grant all on dcs.* to "Ligang" @ "%" identified by "Dcsa99ligang";

MySQL installed on Linux one of the Yum installation

Related Article

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.