One. mysql Installation

Source: Internet
Author: User


1. download mysql to /usr/local/src/

Cd/usr/local/src

wget http://mirrors.sohu.com/mysql/MySQL-5.4/mysql-5.4.3-beta-linux-i686-glibc23.tar.gz

2. Unzip

Tar zxvf mysql-5.4.3-beta-linux-i686-glibc23.tar.gz

3. move the extracted data to the /usr/local/mysql

MV Mysql-5.4.3-beta-linux-i686-glibc23/usr/local/mysql

4. build mysql users

Useradd-s/sbin/nologin MySQL

5. Initializing the database

Cd/usr/local/mysql

Mkdir-p/data/mysql

Chown-r Mysql:mysql/data/mysql

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

--user defines the owner of the database, the --datadir defines where the database is installed, and it is recommended to place the partition on a large space, which needs to be created on its own. This step is critical if you see two "OK" instructions to perform the correct

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7D/E6/wKiom1byTbbSiR2YAAAZJj6qVTc368.png "title=" Two x ok.png "alt=" Wkiom1bytbbsir2yaaazjj6qvtc368.png "/>

by command echo $? , check the return value and return a value of 0 without problems.

6. Copy the configuration file

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

7. Copy the startup script and modify its properties

[email protected] mysql]# CP support-files/mysql.server/etc/init.d/mysqld

[Email protected] mysql]# chmod 755/etc/init.d/mysqld

8. Modify the MySQL startup script

Vim/etc/init.d/mysqld

Modified content:datadir=/data/mysql

/data/mysql is the directory that is defined when the database is initialized.

9. put the boot into the system service like, set boot up, and start MySQL.

[Email protected] mysql]# chkconfig--add mysqld

[Email protected] mysql]# chkconfig mysqld on

[[Email protected] mysql]# service mysqld start

Starting MySQL. success!


One. mysql Installation

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.