Linux yum and source installation MySQL database steps

Source: Internet
Author: User

Environment: CentOS 6.0_x64

Open port: Edit/etc/sysconfig/iptables Add the following record and restart the firewall after saving


-A input-m state--state new-m tcp-p TCP--dport 3306-j ACCEPT

One, method one: Yum installs

1. Install # yum-y install mysql-server mysql-devel mysql


Two, method two: Source code compiles installs

Create users, directories, and Modify permissions

# mkdir-p/usr/local/mysql/data
# Groupadd MySQL
# useradd-g MySQL MySQL
# Chown-r mysql.mysql/usr/local/mysql/data/

Install the required related library files

# yum install-y gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* cm Ake
Decompression mysql-5.5.27.tar.gz
# cd/home/software/
# TAR-ZXV Mysql-5.5.27.tar.gz

Compiling the installation

# CD mysql-5.5.27
# Cmake-dcmake_install_prefix=/usr/local/mysql
# Make && make install
# CP/USR/LOCAL/MYSQL/SUPPORT-FILES/MY-LARGE.CNF/ETC/MY.CNF

Initializing the database

# cd/usr/local/mysql/
# scripts/mysql_install_db--user=mysql--basedir=/usr/local/mysql/--datadir=/usr/local/mysql/data/

Setting up Boot

# Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld
# Chkconfig Mysqld on

Adding environment variables

# echo ' Export path=/usr/local/mysql/bin: $PATH ' >>/etc/profile
# Source/etc/profile

Start the MySQL service

#/etc/init.d/mysqld Start

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.