installation of MySQL under lamp environment

Source: Internet
Author: User

MySQL compilation is troublesome, directly search for the binary package that can not compile

1. Download Mysql

#cd/USR/LOCAL/SRC

#wget http://syslab.comsenz.com/downloads/linux/mysql-5.1.40-linux-i686-icc-glibc23.tar.gz

2 . Decompression

# TAR-XVZF Mysql-5.1.40-linux-i686-icc-glibc23.tar.gz

3.Create mysql account and run MySQL

#useradd-S/sbin/nologin-m MySQL

4. Move and Rename

#mv MySQL 5.1.40-linux-i686-icc-glibc23/usr/local/mysql

5, enter the /usr/local/mysql , create and indicate the user and database directory

#cd/usr/local/mysql; Mkdir-p/data/mysql; Chown-r Mysql:mysql/data/mysql

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

There are two OK initialization complete.

6. Copy the MySQL configuration file to /etc/my.cnf

#cp/usr/local/mysql/support-files/my-large.cnf/etc/my.cnf

7. Copy Startup script

#cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld

chmod 755 mysqld

Vim/etc/init.d/mysqld ====>basedir=/usr/local/mysql Datadir=/data/mysql

8. Join the boot and start

#chkconfig--add mysqld; Chkconfig--level mysqld on

#netstat-LNP | grep mysqld

This article from "Lamp Environment Build" blog, declined reprint!

installation of MySQL under lamp environment

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.