installation of MySQL

Source: Internet
Author: User

1. First add a MySQL user who cannot log in without generating a home directory:

# useradd-s/sbin/nologin-m MySQL #-M is not generated home directory

2. Create a MySQL directory, change the owning group and the owning master for MySQL:

# mkdir-p/data/mysql

# chown-r Mysql:mysql/data/mysql #-R inheritance

3. Under/usr/local/src/, download the 64-bit MySQL package without compiling:

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

# TAR-ZXVF Mysql-5.1.73-linux-x86_64-glibc23.tar.gz

# mv Mysql-5.1.73-linux-x86_64-glibc23/usr/local/mysql # # Move Rename

the 32 bits are as follows :HTTP://MIRRORS.SOHU.COM/MYSQL/MYSQL-5.1/ Mysql-5.1.73-linux-i686-glibc23.tar.gz

4. Initialize:

# Cd/usr/local/mysql

 #  ./scripts/mysql_install_db--user=mysql--datadir=/data/mysql # # Specify data user and data directory

5. Copy the configuration file:

# CD./support-files

# CP MY-LARGE.CNF/ETC/MY.CNF--covers the original my.cnf

# CP Mysql.server/etc/init.d/mysqld--If you encounter the option to overwrite, y can.

6. Modify the configuration parameters:

# vim/etc/init.d/mysqld # # Find the following content, fill the back of the section

Basedir=/usr/local/mysql

Datadir=/data/mysql

--: Wq

7. start MySQL

# Chkconfig--add Mysqld

# Chkconfig Mysqld on

#/etc/init.d/mysqld Start-->start succesful


# PS Aux|grep mysqld can view the process of mysqld.


Because the absolute path of the MySQL command is very long, it is necessary to add the directory where the MySQL command is located in the path:

# vim/etc/init.d/path.sh

#!/bin/bash

Export path= $PATH:/usr/local/mysql/bin/

: Wq

# source/etc/init.d/path.sh

This way, you can start MySQL directly by typing MySQL directly into the command line.

If you find an error, please leave a comment in the comments, thank you 、、、

This article is from the "Liemer_lius blog" blog, make sure to keep this source http://liemerlius.blog.51cto.com/10409683/1696831

installation of MySQL

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.