Summary of Problems in Installing MySQL 5.7.19 under Linux

Summary of Problems in Installing MySQL 5.7.19 under Linux

The first time I installed MySQL on my virtual machine, I encountered many problems. I wrote them down here and shared them with you.

linux centOS 6

mysql version mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz

1. groupadd mysql ## Add a mysql group

2. useradd -r -g mysql mysql ## Add a user

3. Unzip the downloaded package, tar -xzvf /usr/local/mysql-5.7.13-linux-glibc2.5-x86_64.tar.gz

4. mv /usr/local/mysql-5.7.13-linux-glibc2.5-x86_64 /usr/local/mysql ##Rename

Directory after decompression:

5. mkdir /usr/local/mysql/data ## By default, there is no such folder for storing data.

6. chown -R mysql:mysql ./ ##Enter the mysql package and authorize this package to mysql

7. chgrp -R mysql:mysql ./ ##Enter the mysql package

8. bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data ##Enter the mysql file name. basedir is the path of mysql, and datadir is the data package of mysql, which contains mysql's own packages, such as user

There are many tutorials online that use the mysql_install_db installation method. I also installed it this way at the beginning, but all kinds of errors and failures occurred. The mysql_install_db command is not recommended. Just follow the command above.

Here you need to record the generated temporary password, as shown above: YLi>7ecpe;YP

9. bin/mysql_ssl_rsa_setup --datadir=/usr/local/mysql/data

10. Enter mysql support-file

11. cp my-default.cnf /etc/my.cnf

I found that this version does not have my-default

Now it's time to create one ourselves (the internal code is shown in the figure): The values ​​corresponding to the two sockets (red) below must be consistent, otherwise the connection will not work after startup.

: : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :

12. cp mysql.server /etc/init.d/mysql

13. vim /etc/init.d/mysql ##Modify basedir=your own path Modify datadir=your own path

14. bin/mysqld_safe --user=mysql & ## Start mysql

13. ./mysql -uroot -p ##bin directory

14. Enter a temporary password

15. Change the root password of MySQL

At this time, mysql can only be accessed by local localhost

16 Modify remote access

Restart MySQL service

At this point, you can use MySQL normally locally

Testing Remote Connection

Summarize

The above is a summary of the problems of installing MySQL5.7.19 under Linux 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:
  • How to install multiple mysql5.7.19 (tar.gz) files under Linux
  • MySQL 5.7.19 (tar.gz) installation graphic tutorial under Linux
  • MySQL 5.6.27 Installation Tutorial under Linux
  • Linux CentOS6.5 yum install mysql5.6
  • Problems with installing mysql and mysql.sock under linux

<<:  Tips for viewing History records and adding timestamps in Linux

>>:  Organize the common knowledge points of CocosCreator

Recommend

Three commonly used MySQL data types

Defining the type of data fields in MySQL is very...

jQuery custom magnifying glass effect

This article example shares the specific code of ...

Getting Started Tutorial for Beginners⑧: Easily Create an Article Site

In my last post I talked about how to make a web p...

Unicode signature BOM (Byte Order Mark) issue for UTF-8 files

I recently encountered a strange thing when debug...

Detailed explanation of the WeChat applet request pre-processing method

question Because some of our pages request data i...

Two common solutions to html text overflow display ellipsis characters

Method 1: Use CSS overflow omission to solve The ...

Why TypeScript's Enum is problematic

Table of contents What happened? When to use Cont...

A good way to improve your design skills

So-called talent (left brain and right brain) Tha...

Solution - BASH: /HOME/JAVA/JDK1.8.0_221/BIN/JAVA: Insufficient permissions

1) Enter the folder path where the jdk file is st...

JavaScript code to achieve a simple calendar effect

This article shares the specific code for JavaScr...

The role and opening of MySQL slow query log

Preface The MySQL slow query log is a type of log...

Summary of front-end knowledge in the Gokudō game

background In the early stages of learning Japane...

JavaScript built-in date and time formatting time example code

1. Basic knowledge (methods of date objects) 😜 ge...

The pitfalls of deploying Angular projects in Nginx

Searching online for methods to deploy Angular pr...

MySQL study notes on handling duplicate data

MySQL handles duplicate data Some MySQL tables ma...