MySQL installation binary

Source: Internet
Author: User

Install one of the MySQL methods, compared to the source package and RPM installation convenient many

can go directly to the official download binary package


Need to uninstall MARIADB first

RPM-E Mariadb-libs--nodeps

Unzip directly, move

Tar zxf mysql-5.7.20-linux-glibc2.12-x86_64.tar.gzmv mysql-5.7.20-linux-glibc2.12-x86_64/usr/local/mysql

Create users and Groups

Groupadd Mysqluseradd-r-G mysql-s/bin/false MySQL

Edit Master profile (start only, other configurations can be added by yourself)

echo [mysqld] >/etc/my.cnfecho socket=/tmp/mysql.sock >>/etc/my.cnfecho basedir=/usr/local/mysql >>/ Etc/my.cnfecho Datadir=/usr/local/mysql/data >>/etc/my.cnf

Create a data directory and grant permissions

Mkdir/usr/local/mysql/datacd/usr/local/mysql/chmod datachown-r MySQL. chgrp-r MySQL.

Adding environment variables

echo "Export path= $PATH:/usr/local/mysql/bin" >>/etc/profilesource/etc/profile

Initialization

Bin/mysqld--initialize--user=mysql

Boot, and start

CP/USR/LOCAL/MYSQL/SUPPORT-FILES/MYSQL.SERVER/ETC/INIT.D/MYSQLDSYSTEMCTL Daemon-reloadsystemctl Enabled Mysqlsystemctl start MySQL

Set MySQL password

Cd/usr/local/mysql/bin/mysqladmin-u Root-password 123456


After setting the password, you can log in normally, and we recommend this method

MySQL installation binary

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.