MySQL binary file specification installation

Source: Internet
Author: User

Presentation Environment Introduction

Operating system: CentOS 6.7 (64-bit)

Binary package: mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz

mysql:http://dev.mysql.com/downloads/

1. Download MySQL

# Mkdir/root/mysql

# Cd/root/mysql

# wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.30-linux-glibc2.5-x86_64.tar.gz

2. Decompression

# cd/opt/
# mkdir MySQL
# CD MySQL
# tar zxvf/root/mysql/mysql-5.6.30 ....
# ln-s/opt/mysql/mysql-5.6.30-linux-glibc2.5-x86_64/usr/local/mysql
# Cd/usr/local/mysql

3. Create user

# Groupadd MySQL
# useradd-g mysql-m-s/sbin/nologin MySQL

4. Environment variables

# Vim/etc/profile
Path= $PATH:/usr/local/mysql
# Source/etc/profile

5. Create the required directory
/data/mysql/mysql3376/
Data Catalog
TMP temp File
Logs binary log directory
# Mkdir-p/data/mysql/mysql3376/{data,tmp,logs}


6. Permissions
# Chown-r mysql:mysql/data/mysql/mysql3376/
# Chown-r Mysql:mysql/opt/mysql
# Chown-r Mysql:mysql/usr/local/mysql

7. Create a configuration file

[Client]port=3376Socket=/tmp/mysql3376.sock# the MySQL server[mysqld]# basicport=3376User=Mysqlbasedir=/usr/local/Mysqldatadir=/data/mysql/mysql3376/Datatmpdir=/data/mysql/mysql3376/Tmpsocket=/tmp/Mysql3376.socklog-bin =/data/mysql/mysql3376/logs/mysql-Binlog-error =Error.logslow-query-log-file=Slow.logskip-external-Lockingskip-name-Resolvelog-slave-updates

8. Initialization

# Cd/usr/local/mysql
#./scripts/mysql_install_db--defaults-file=/etc/my.cnf

See two times OK

9. Start & Close

Start:
#/usr/local/mysql/bin/mysqld_safe--DEFAULTS-FILE=/ETC/MY.CNF &

Or

#/usr/local/mysql/bin/mysqld--DEFAULTS-FILE=/ETC/MY.CNF &

Shut down:
#/usr/local/mysql/bin/mysqladmin-s/tmp/mysql3376.sock shutdown


10. Safety Reinforcement

# Delete from Mysql.user where user!= ' root ' or host!= ' localhost ';
# TRUNCATE TABLE mysql.db;
# drop database test;
# flush Privileges;

How do I confirm that MySQL is up?

A to see if A process exists
# PS Axu |grep mysqld
B See if the port is listening correctly
# SS-LNPT |grep mysqld

C See if there are any exceptions to the error log

MySQL binary file specification 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.