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

JavaScript built-in date and time formatting time example code

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

Complete steps to configure a static IP address for a Linux virtual machine

Preface In many cases, we will use virtual machin...

MySQL database operations and data types

Table of contents 1. Database Operation 1.1 Displ...

JS achieves five-star praise case

This article shares the specific code of JS to ac...

Sample code for generating QR code using js

Some time ago, the project needed to develop the ...

Example method to view the IP address connected to MySQL

Specific method: First open the command prompt; T...

What is BFC? How to clear floats using CSS pseudo elements

BFC Concept: The block formatting context is an i...

Detailed explanation of how to restore database data through MySQL binary log

Website administrators often accidentally delete ...

Node+Express test server performance

Table of contents 1 Test Environment 1.1 Server H...

The most common mistakes in HTML tag writing

We better start paying attention, because HTML Po...

MySQL 5.7.23 installation and configuration method graphic tutorial

This article records the installation tutorial of...

Detailed explanation of three methods of JS interception string

JS provides three methods for intercepting string...

Detailed explanation of where the image pulled by docker is stored

20200804Addendum: The article may be incorrect. Y...

MySql inserts data successfully but reports [Err] 1055 error solution

1. Question: I have been doing insert operations ...

Detailed explanation of dynamically generated tables using javascript

*Create a page: two input boxes and a button *Cod...