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

What you need to know about creating MySQL indexes

Table of contents Preface: 1. Create index method...

Mysql 5.7.18 Using MySQL proxies_priv to implement similar user group management

Use MySQL proxies_priv (simulated role) to implem...

Detailed explanation of how to cleanly uninstall Docker

First, the server environment information: Reason...

How to forget the root password in Mysql8.0.13 under Windows 10 system

1. First stop the mysql service As an administrat...

Thoughts on truncation of multi-line text with a "show more" button

I just happened to encounter this small requireme...

Detailed explanation of replace into example in mysql

Detailed explanation of replace into example in m...

Teach you step by step to develop a brick-breaking game with vue3

Preface I wrote a few examples using vue3, and I ...

Ubuntu compiles kernel modules, and the content is reflected in the system log

Table of contents 1.Linux login interface 2. Writ...

Image hover toggle button implemented with CSS3

Result:Implementation Code html <ul class=&quo...

React High-Order Component HOC Usage Summary

One sentence to introduce HOC What is a higher-or...

Several situations where div is covered by iframe and their solutions

Similar structures: Copy code The code is as foll...

A complete guide to clearing floats in CSS (summary)

1. Parent div defines pseudo-classes: after and z...

Example of implementing load balancing with Nginx+SpringBoot

Introduction to Load Balancing Before introducing...