VMWare Linux MySQL 5.7.13 installation and configuration tutorial

VMWare Linux MySQL 5.7.13 installation and configuration tutorial

This article shares with you the tutorial of installing MySQL 5.7.13 on VMWare Linux for your reference. The specific content is as follows

1. Basic environment description

Virtual Machine: VMWare

Operating system: Linux

Database version: MySQL 5.7.13 Community Edition (don’t ask why not install the Enterprise Edition, because the Enterprise Edition costs money)

Background: The virtual machine can connect to the external network

2. Find out the details

Check if MySQL is already installed on Linux

① Start the service service mysqld start

If it is not installed, it will prompt

② Check whether the service exists on Linux chkconfig --list mysqld

If it is not installed, it will prompt

3. Create a /tools directory (download the file to this directory) and enter the /tools directory

# mkdir /tools
# cd /tools

4. Download MySQL 5.7.13

#wget http://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.13-linux-glibc2.5-x86_64.tar.gz

5. Decompression

# tar -xzf mysql-5.7.13-linux-glibc2.5-x86_64.tar.gz

6. Create directory /data/mysql (installation directory)

# cd /
# mkdir data
# cd /data
# mkdir mysql

7. Create new mysql users, groups and directories

# groupadd mysql
# useradd -r -s /sbin/nologin -g mysql mysql -d /tools/mysql-5.7.13-linux-glibc2.5-x86_64

8. Switch directory and grant permissions

#cd /tools/mysql-5.7.13-linux-glibc2.5-x86_64
#pwd
#chown –R mysql .
#chgrp –R mysql .

#chown -R mysql /data/mysql

If steps 6-8 are not done, an error will be reported: bin/mysqld: no such file or directory

9. Set parameters

# bin/mysqld --initialize --user=mysql --basedir=/tools/mysql-5.7.13-linux-glibc2.5-x86_64 --datadir=/data/mysql

Note: remember the temporary password in the red box, you will need it later.

#bin/mysql_ssl_rsa_setup --datadir=/data/mysql

10. Modify the configuration file

# cd support-files 

# cp my-default.cnf /etc/my.cnf
# cp mysql.server /etc/init.d/mysql

# vim /etc/init.d/mysql

Modify the following:

# vim /etc/my.cnf

Modify the following:

After the modification, it is best to check it again. Sometimes accidental spelling mistakes can lead to a lot of messy errors.

11. Start mysql

Note: Check if the path used in the my.cnf configuration file exists. If it does not exist, create it yourself.

# bin/mysqld_safe --user=mysql &

bin/mysql --user=root –p

--Enter the temporary password generated in step 9

12. Change the root password

mysql> set password=password('123456'); --Enter a new password

13. Grant permissions

mysql> grant all privileges on *.* to 'root'@'%' identified by '123456';
mysql> flush privileges;

14. Check the results

mysql> use mysql;
mysql> select host,user from user;
mysql> exit;

15. Add system path

# vim /etc/profile

Add to:
export PATH=/usr/local/mysql/bin:$PATH

# source /etc/profile

16. Configure MySQL to start automatically

# chmod 755 /etc/init.d/mysql
# chkconfig --add mysql
# chkconfig --level 345 mysql on

Most of the above configurations refer to: MySQL 5.7.13 Installation and Configuration Methods Graphic Tutorial

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Solve the problem that Navicat cannot connect to the MySQL server in the Centos system in VMware
  • Install CentOS7 in VMware (set static IP address) and install mySql database through docker container (super detailed tutorial)
  • How to share MySQL database in Linux in VMware
  • MySQL8.0 installation process under Centos7 in VMware workstation16 and Navicat remote connection

<<:  WeChat Mini Program user authorization to obtain mobile phone number (getPhoneNumber)

>>:  How to implement Linux disk mounting, partitioning, and capacity expansion operations

Recommend

Dissecting the advantages of class over id when annotating HTML elements

There are very complex HTML structures in web pag...

Centos7 installation of Nginx integrated Lua sample code

Preface The computer I use is a Mac, and the oper...

Code to enable IE8 in IE7 compatibility mode

The most popular tag is IE8 Browser vendors are sc...

Tutorial on setting up scheduled tasks to backup the Oracle database under Linux

1. Check the character set of the database The ch...

MySQL uses find_in_set() function to implement where in() order sorting

This article introduces a tutorial about how to u...

How is MySQL transaction isolation achieved?

Table of contents Concurrent scenarios Write-Writ...

Solution to the conflict between nginx and backend port

question: When developing the Alice management sy...

Vue custom directive details

Table of contents 1. Background 2. Local custom i...

CSS to implement sprites and font icons

Sprites: In the past, each image resource was an ...

A record of a Linux server intrusion emergency response (summary)

Recently, we received a request for help from a c...

Detailed explanation of Js class construction and inheritance cases

The definition and inheritance of classes in JS a...

Use Navicate to connect to MySQL on Alibaba Cloud Server

1. First enter the server's mysql to modify p...

How to implement mobile web page size adaptation

I finally finished the project at hand, and the m...