installing MySQL under CentOS

Source: Internet
Author: User

Download the MySQL installation package and note the number of system bits.

Cd/usr/local/src

wget http://mirrors.sohu.com/mysql/MySQL-5.1/mysql-5.1.73-linux-i686-glibc23.tar.gz

Unpack the installation package:

Tar zxvf mysql-5.1.73-linux-i686-glibc23.tar.gz

Initialization

Useradd-s/sbin/nologin-m MySQL

MV Mysql-5.1.73-linux-i686-glibc23/usr/local/mysql

Mkdir-p/data/mysql

Chown-r Mysql/data/mysql

/usr/local/mysql

./scripts/mysql_install_db--user=mysql--datadir=/data/mysql

echo $? or appear OK

Copy configuration files and startup scripts

Cd/usr/local/mysql/support-files

CP MY-LARGE.CNF/ETC/MY.CNF

VIM/ETC/MY.CNF//Edit or modify, note the following.

Log-bin=mysql-bin

Binlog_format=mixed

Server-id = 1



Startup file:

Cd/usr/local/mysql/support-files

CP Mysql.server/etc/init.d/mysqld

Vim/etc/init.d/mysqld//Edit or modify

Basedir=/usr/local/mysql

Datadir=/data/mysql

Chkconfig--add mysqld

Chkconfig mysqld on

/etc/init.d/mysqld start

To view a process:

PS aux |grep mysqld

NETSTAT-NLP |grep mysqld

Change the path/usr/local/mysql/bin/mysql/usr/bin/mysql of MySQL

Create user mysqladmin-uroot password 12345 user login mysql-uroot-p12345


installing MySQL under CentOS

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.