CentOS7 installing MySQL on a virtual machine

Source: Internet
Author: User

1. Download
: Http://dev.mysql.com/downloads/mysql/5.6.html#downloads
Download version: I choose here 5.6.33, General edition, Linux under 64-bit
You can also directly copy the 64-bit, download by command:
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz

2. Installation dependent

#安装依赖yum-y Install perl perl-devel autoconf Libaio

3. Decompression

#解压tar-zxvf mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz# Copy the extracted MySQL directory cp-r mysql-5.6.33-linux-glibc2.5-x86_64/usr/ local# renaming MV mysql-5.6.33-linux-glibc2.5-x86_64 MySQL

4. Adding user groups and users

#添加用户组groupadd mysql# Add user MySQL to user group Mysqluseradd-r-G mysql-s/bin/false MYSQLL

5, go to install MySQL software directory, modify the directory owner for the MySQL user

CD Mysql/chown-r Mysql:mysql./

6. Install the database

CD mysql/./scripts/mysql_install_db--user=mysql

7, modify the current directory owner is the root user

Chown-r Root:root./

8. Modify the current data directory owner as a MySQL user

Chown-r Mysql:mysql Data

9. Add MySQL service boot from boot

CP support-files/mysql.server/etc/init.d/mysql# gives executable permissions chmod +x/etc/init.d/mysql# add service chkconfig--add mysql# Show Service list Chkconfig--list

If you see the MySQL service and the 3,4,5 is on, it succeeds if it is off, then executes

Chkconfig--level 345 MySQL on

10. Start the MySQL service

#创建缺少的文件夹mkdir/var/log/mariadbservice MySQL Start

Normal tip information:starting MySQL. Success!

11. Put the MySQL client on the default path

Ln-s/usr/local/mysql/bin/mysql/usr/local/bin/mysql

12. Add MySQL command

# ln-s/usr/local/mysql/bin/mysql/usr/bin

13. Log in to MySQL

# Mysql-uroot-proot

======================= to this database installation ===========================================


CentOS7 installing MySQL on a virtual machine

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.