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

MySQL index cardinality concept and usage examples

This article uses examples to explain the concept...

Implementation of Docker deployment of web projects

The previous article has installed the docker ser...

Detailed explanation of the solution to the nginx panic problem

Regarding the nginx panic problem, we first need ...

Bootstrap3.0 study notes table related

This article mainly explains tables, which are no...

Example code for implementing background transparency and opaque text with CSS3

Recently, I encountered a requirement to display ...

A mobile adaptive web page effect solves the problem of small display page

For work needs, I need to make a mobile phone adap...

Use of Linux bzip2 command

1. Command Introduction bzip2 is used to compress...

What to do if you forget the initial password when installing MySQL on Mac

Forgetting the password is a headache. What shoul...

Centos7 mysql database installation and configuration tutorial

1. System environment The system version after yu...

Implementation example of scan code payment in vue project (with demo)

Table of contents Demand background Thought Analy...

Implementation of Nginx domain name forwarding

Introduction to Nginx Nginx ("engine x"...

Explanation of the configuration and use of MySQL storage engine InnoDB

MyISAM and InnoDB are the most common storage eng...

A brief introduction to mysql mycat middleware

1. What is mycat A completely open source large d...

Markup Language - Anchor

Previous: Markup Language - Phrase Elements Origin...