Installation method of MySQL in the prelude to lamp construction

Source: Internet
Author: User
Tags mysql create mysql free

MySQL Installation--free compilation installation

    1. Download MySQL free compile package first

      http://mirrors.sohu.com/

      The MySQL installation.

1) How many bits of the system are required to install MySQL.

Uname-a to see if the system is 32-bit or 64-bit.

2. Basically download the free compiler package placed under/usr/local/src/

1.cd/usr/local/src/

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

When an error occurs,

Yum install-y wget

2. After the current download, unzip

1.1

#tar zxvf/usr/local/src/mysql-5.1.73-linux-i686-glibc23.tar.gz

1.2

#mv/usr/local/src/mysql-5.1.73-linux-i686-glibc23.tar.gz/usr/local/mysql Move Rename

1.3

#useradd-S/sbin/nologin-m mysql create MySQL and disable login, do not generate home directory.

1.4

#mkdir-P/data/mysql

1.5

#chown-R Mysql/data/mysql

1.6

#cd/usr/local/mysql

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

When you are done

echo $? When the return value is 0 o'clock, it indicates that initialization is normal. It is not normal with numbers.

3. Configure MySQL

CP support-file/my-large.cnf/etc/my.cnf Copy configuration file Rename

CP Support-file/mysql.server/etc/init.d/mysqld

chmod 755/etc/init.d/msqld


4. Modify the startup script.

Vim/etc/init.d/mysqld

Put Datadir=/data/mysql

Put Basedir=/usr/local/mysql

: Wq


Chkconfig-add MySQL

Chkconfig mysqld on

/etc/init.d/mysqld Start or service mysqld start

When there's a problem.

You can view the error log for data/mysql/.

Typically, this file is the hostname. err

5. Check to see if it is turned on

PS aux |grep mysqld

NETSTAT-LNP |mysqld






This article from the "Linux Learning Space" blog, reproduced please contact the author!

Installation method of MySQL in the prelude to lamp construction

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.