Detailed installation process of MySQL5.6.40 under CentOS7 64

Detailed installation process of MySQL5.6.40 under CentOS7 64

MySQL5.6.40 installation process under CentOS7 64

1) Uninstall the previously installed MySQL

rm -rf /usr/local/mysql
rm -rf /etc/init.d/mysqld

2) Delete the database directory

rm -rf /data/mysql/

3) Install dependent packages after uninstallation to avoid problems during installation

yum -y install wget vim bash-completion
yum -y install gcc gcc-c++ cmake ncurses-devel autoconf perl perl-devel

4) Download mysql-5.6.40.tar.gz

wget https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.40.tar.gz

5) Create the MySQL installation directory, data storage directory, and user group

mkdir -p /usr/local/mysql/data
groupadd mysql
useradd -r -g mysql mysql

6) Unzip the file to the current folder and install

tar -zxvf mysql-5.6.40.tar.gz
cd mysql-5.6.40
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ #Default installation directory -DINSTALL_DATADIR=/usr/local/mysql/data \ #Database storage directory -DDEFAULT_CHARSET=utf8 \ #Use utf8 characters -DDEFAULT_COLLATION=utf8_general_ci \ #Check characters -DEXTRA_CHARSETS=all \ #Install all extended character sets -DENABLED_LOCAL_INFILE=1 #Allow data to be imported locally make && make install

7) Set directory permissions

cd /usr/local/mysql
chown -R mysql:mysql .
chown -R mysql:mysql data

8) Add the mysql startup service to the system services

sp support-files/my-default.cnf /etc/my.cnf

9) Create a basic table

./scripts/mysql_install_db --user=mysql

10) Configure the environment variables and add them

vim /etc/profile
export MYSQL_HOME="/usr/local/mysql"
export PATH="$PATH:$MYSQL_HOME/bin"
#:wqSave and exitsource /etc/profile

11) Add the mysql startup file to the system startup file

cp support-files/mysql.server /etc/init.d/mysql

12) mysql command under centOS7

systemctl start mysql
systemctl restart mysql
systemctl stop mysql
systemctl enable mysql

13) Change mysql password

mysqladmin -u root password

14) Connect to MySQL

mysql -uroot -p
****** #Enter password exit #Exit

Summarize

This is the end of this article about the installation process of MySQL5.6.40 under CentOS7 64. For more information about installing MySQL5.6.40 on CentOS7, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed tutorial on installing MySQL 8.0.20 database on CentOS 7
  • Detailed tutorial on installing mysql 8.0.20 on CentOS7.8
  • Tutorial analysis of quick installation of mysql5.7 based on centos7
  • Detailed tutorial on how to compile and install mysql8.0.29 in CentOS8 deployment LNMP environment
  • CentOS7.5 installation of MySQL8.0.19 tutorial detailed instructions
  • Install CentOS7 in VMware (set static IP address) and install mySql database through docker container (super detailed tutorial)
  • Centos7 mysql database installation and configuration tutorial

<<:  An article teaches you JS function inheritance

>>:  Analysis of Alibaba Cloud CentOS7 server nginx configuration and FAQs

Recommend

How to view mysql binlog (binary log)

For example, when you create a new table or updat...

Share JS four fun hacker background effect codes

Table of contents Example 1 Example 2 Example 3 E...

Proxy realizes the principle of two-way binding of Vue3 data

Table of contents 1. Advantages of proxy vs. Obje...

jQuery implements navigation bar effect with expansion animation

I designed and customized a navigation bar with a...

Two ways to connect WeChat mini program to Tencent Maps

I've been writing a WeChat applet recently an...

Use of MySQL truncate table statement

The Truncate table statement is used to delete/tr...

PNG Alpha Transparency in IE6 (Complete Collection)

Many people say that IE6 does not support PNG tra...

Detailed process of upgrading gcc (version 10.2.0) under CentOS7 environment

Table of contents Short Introduction 1. Check the...

What knowledge systems do web designers need?

Product designers face complex and large manufactu...

Process analysis of deploying ASP.NET Core applications on Linux system Docker

Table of contents 1. System environment 2. Operat...

Detailed explanation of efficient MySQL paging

Preface Usually, a "paging" strategy is...

Detailed explanation of Vue custom instructions

Table of contents Vue custom directive Custom dir...

What are the drawbacks of deploying the database in a Docker container?

Preface Docker has been very popular in the past ...

Detailed explanation of jQuery chain calls

Table of contents Chain calls A small case Chain ...