How to install mysql5.7.24 binary version on Centos 7 and how to solve it

How to install mysql5.7.24 binary version on Centos 7 and how to solve it

MySQL binary installation method

Download mysql

https://dev.mysql.com/downloads/mysql/

1. Unzip the package

tar xf mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz

2. Actual production environment

mv mysql-5.7.24-linux-glibc2.12-x86_64 /usr/local/mysql5.7

a. Add a new Mysql user group

 groupadd mysql

b. Add new users

opt]# useradd -r -g mysql mysql

C. Give mysql directory permissions

chown -R mysql:mysql mysql5.7

3. Go to the directory where the environment is initialized

 Cd /home/usr/local/mysql5.6/
mkdir data
mkdir log
chown -R mysql:mysql mysql5.7

4. Initialize data and specify installation directory and data directory

./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql5.7/ --datadir=/usr/local/mysql5.7/data/

6 Copy the startup file

 cp mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld

7. Modify the startup path

 vi /etc/init.d/mysqld
basedir= /usr/local/mysql5.7
datadir= /usr/local/mysql5.7/data

8. Add environment variables (add at the bottom) l

 vi /etc/profile
export MYSQL_HOME=" /usr/local/mysql5.7"
export PATH="$PATH:$MYSQL_HOME/bin"

9. Refresh the configuration file

source /etc/profile

Modify the configuration file

vi /etc/my.cnf
[client]
port=3306
[mysqld]
basedir=/usr/local/mysql5.7
datadir=/usr/local/mysql5.7/data
#socket=/usr/local/mysql5.7/mysql.sock
socket=/tmp/mysql.sock
user=mysql
#skip-grant-tables
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
log-error=/usr/local/mysql5.7/log/mysqld.log
pid-file=/usr/local/mysql5.7/data/mysqld.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

11. Add automatic start

 chkconfig --add mysqld
 chkconfig mysqld on

12. Start mysqld

 service mysqld start
 netstat -anpt

13. Change the password (there is a password when the password is initialized)

2018-11-02T02:07:44.574468Z 1 [Note] A temporary password is generated for root@localhost: lXyB0%fi#9-S (this is the password)
mysql> help contents
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> help contents
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

Solution

1. Change user password

mysql> alter user 'root'@'localhost' identified by 'youpassword';

or

mysql> set password=password("youpassword");

2. Refresh permissions

mysql> flush privileges;
mysql> help contents

Summarize

The above is the method of installing mysql5.7.24 binary version on Centos 7 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • MySQL 5.7.18 binary package installation tutorial under Linux (without default configuration file my_default.cnf)
  • Deploy MySQL 5.7.17 binary installation and multi-instance configuration on CentOS 6.5
  • Detailed tutorial on customizing the installation path of MySQL 5.7.18 version (binary package installation)
  • Centos7.5 installs mysql5.7.24 binary package deployment
  • Detailed tutorial on installing MySQL 5.7.11 for Linux Generic binary version in CentOS 7 via command line
  • Tutorial on installing MySQL 5.6.20 using Linux binary universal package
  • Install mysql5.6 in ubuntu system (through binary)
  • mysql 5.7.19 latest binary installation
  • MySQL 5.6.24 (binary) automatic installation script under Linux
  • The whole process record of MySQL binary installation and backup

<<:  Detailed explanation of the specific use of the ENV instruction in Dockerfile

>>:  Vue implements adding, displaying and deleting multiple images

Recommend

Problems and solutions for installing Docker on Alibaba Cloud

question When installing Docker using Alibaba Clo...

vue-table implements adding and deleting

This article example shares the specific code for...

Sample code for modifying the input prompt text style in html

On many websites, we have seen the input box disp...

JavaScript implementation of magnifying glass details

Table of contents 1. Rendering 2. Implementation ...

Three ways to implement animation in CSS3

This is a test of the interviewee's basic kno...

Detailed example of deploying Nginx+Apache dynamic and static separation

Introduction to Nginx dynamic and static separati...

MySQL installation and configuration tutorial for Mac

This article shares the MySQL installation tutori...

Detailed graphic tutorial on installing centos7 virtual machine in Virtualbox

1. Download centos7 Download address: https://mir...

In-depth explanation of currying of JS functions

Table of contents 1. Supplementary knowledge poin...

Tips for Mixing OR and AND in SQL Statements

Today, there is such a requirement. If the logged...

Solution to mysql prompt "got timeout reading communication packets"

Error message: user: 'root' host: `localh...

JavaScript color viewer

This article example shares the specific code of ...

Example of deploying Laravel application with Docker

The PHP base image used in this article is: php:7...