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

Example of exporting and importing Docker containers

Table of contents Exporting Docker containers Imp...

Detailed explanation of flex layout in CSS

Flex layout is also called elastic layout. Any co...

Detailed explanation of long transaction examples in MySQL

Preface: The "Getting Started with MySQL&quo...

Implementation of iview permission management

Table of contents iview-admin2.0 built-in permiss...

Centos7.3 automatically starts or executes specified commands when booting

In centos7, the permissions of the /etc/rc.d/rc.l...

How to distinguish MySQL's innodb_flush_log_at_trx_commit and sync_binlog

The two parameters innodb_flush_log_at_trx_commit...

SQL Optimization Tutorial: IN and RANGE Queries

Preface "High Performance MySQL" mentio...

How to process blob data in MySQL

The specific code is as follows: package epoint.m...

How to install MySQL and MariaDB in Docker

Relationship between MySQL and MariaDB MariaDB da...

Detailed explanation of log processing of Docker containers

Docker has many log plug-ins. The default is to u...

Detailed explanation of the error problem of case when statement

Preface In the MySQL database, sometimes we use j...

Linux View File System Type Example Method

How to check the file system type of a partition ...

Detailed tutorial on installing Docker and docker-compose suite on Windows

Table of contents Introduction Download and insta...

How to install the latest version of docker using deepin apt command

Step 1: Add Ubuntu source Switch to root su root ...

Analysis of permissions required to run docker

Running Docker requires root privileges. To solve...