MySQL 5.7.16 installation and configuration method graphic tutorial (Ubuntu 16.04)

MySQL 5.7.16 installation and configuration method graphic tutorial (Ubuntu 16.04)

How to install MySQL 5.7 in Ubuntu 16.04?

Install the main program

There are two ways to install the main program as far as I know:
- Fully automatic installation using apt-get

# Installation command apt-get install mysql-server
# You need to enter the mysql root password during the installation process

Manually install dependency packages using dpkg

# 1. Download the installation package# During my test, I downloaded: mysql-server_5.7.16-1ubuntu16.04_amd64.deb-bundle.tar
# Domestic mirror site: http://mirrors.sohu.com/mysql/MySQL-5.7/

wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-server_5.7.16-1ubuntu16.04_amd64.deb-bundle.tar

# 2. Unzip the installation package# After unzipping, the following will appear:
# libmysqlclient20_5.7.16-1ubuntu16.04_amd64.deb
#mysql-common_5.7.16-1ubuntu16.04_amd64.deb  
#mysql-community-source_5.7.16-1ubuntu16.04_amd64.deb 
#mysql-testsuite_5.7.16-1ubuntu16.04_amd64.deb
# libmysqlclient-dev_5.7.16-1ubuntu16.04_amd64.deb 
#mysql-community_5.7.16-1ubuntu16.04_amd64.changes 
#mysql-community-test_5.7.16-1ubuntu16.04_amd64.deb 
# libmysqld-dev_5.7.16-1ubuntu16.04_amd64.deb 
#mysql-community-client_5.7.16-1ubuntu16.04_amd64.deb 
#mysql-server_5.7.16-1ubuntu16.04_amd64.deb
#mysql-client_5.7.16-1ubuntu16.04_amd64.deb 
#mysql-community-server_5.7.16-1ubuntu16.04_amd64.deb

tar -xvf ../mysql-server_5.7.16-1ubuntu16.04_amd64.deb-bundle.tar -C ./

# 3. Use dpkg to install the dependency package dpkg -i mysql-common_5.7.16-1ubuntu16.04_amd64.deb
dpkg -i libmysqlclient20_5.7.17-1ubuntu16.04_amd64.deb 
dpkg -i libmysqlclient-dev_5.7.17-1ubuntu16.04_amd64.deb 
dpkg -i libmysqld-dev_5.7.17-1ubuntu16.04_amd64.deb

# There should be no problem installing the above four packages. The next package to be installed will throw an error about missing dependency packages. # I forgot to write down the missing package name at the time. Please read the error message carefully and then install it using apt-get. dpkg -i mysql-community-client_5.7.17-1ubuntu16.04_amd64.deb 
dpkg -i mysql-client_5.7.17-1ubuntu16.04_amd64.deb 
dpkg -i mysql-community-source_5.7.17-1ubuntu16.04_amd64.deb

# Next we need to install the mysql-community-server package. Before installing it, we need to install a dependency package: libmecab2

apt-get install libmecab2
dpkg -i mysql-community-server_5.7.17-1ubuntu16.04_amd64.deb 
## You need to enter the mysql root password during the installation process

At this point, we have completed the main program installation and can use MySQL -u root -p to log in to the database on this machine.

Open remote access

Enable full access rights for the root user
1. Modify the host of the user in the database

sh 
# Use mysql -u root -p to log in to the database, and then execute the following statements in sequence # xxxxxx represents the password of the root user use mysql; 
update user set host = '%' where user = 'root'; 
grant all privileges on *.* to 'root'@'%' identified by 'xxxxxx'; 
flush privileges; 

2. Modify the IP binding in my.conf

sh 
# Enter and edit /etc/mysql/mysql.conf.d/mysqld.conf 
vi /etc/mysql/mysql.conf.d/mysqld.conf 
# Modify ip binding# The source file is: 
bind-address 127.0.0.1 
# Change it to: 
bind-address 0.0.0.0 
# Overwrite and save esc:wq 

3. Restart the database

sh 
# Restart command service mysql restart 

Add a new user and allow remote access

# To add a new user and allow remote access, just add a user to the user table and set the host to %. # The following example assigns all permissions to the new user by default, for example:
grant all privileges on *.* to 'lethew'@'%' identified by 'abcdef';
flush privileges;

References

Main program installation: https://www.jb51.net/article/103353.htm

Open remote access: https://www.jb51.net/article/103764.htm

Solve the 10061 problem: https://www.digitalocean.com/community/questions/can-t-connect-to-mysql-server-on-ipaddress-10061

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:
  • Ubuntu 18.04 installs mysql 5.7.23
  • Install mysql5.7 on Ubuntu 18.04
  • Install MySQL 5.7 on Ubuntu 18.04
  • Ubuntu16.04 installation mysql5.7.22 graphic tutorial
  • Tutorial on installing Tomcat8.5 and MySQL5.7 on Ubuntu16
  • Manually install mysql5.7.10 on Ubuntu
  • Tutorial on installing MySQL 5.7 on Ubuntu 16.04
  • MySQL 5.7.17 installation and configuration tutorial under Linux (Ubuntu)
  • MySQL 5.7.17 installation and configuration method graphic tutorial (Ubuntu 16.04)
  • Tutorial on installing mysql5.7.23 on Ubuntu 18.04

<<:  Detailed explanation of the data responsiveness principle of Vue

>>:  7 Best VSCode Extensions for Vue Developers

Recommend

What is TypeScript?

Table of contents 1. JavaScript issues 2. Advanta...

Solve the problem of managing containers with Docker Compose

In Docker's design, a container runs only one...

JavaScript two pictures to understand the prototype chain

Table of contents 1. Prototype Relationship 2. Pr...

Introduction to MySQL overall architecture

The overall architecture of MySQL is divided into...

Realize map aggregation and scattering effects based on vue+openlayer

Table of contents Preface: Result: 1. Polymerizat...

CSS3 realizes bouncing ball animation

I usually like to visit the special pages or prod...

Build a server virtual machine in VMware Workstation Pro (graphic tutorial)

The VMware Workstation Pro version I use is: 1. F...

Example of implementing skeleton screen with Vue

Table of contents Skeleton screen use Vue archite...

Using js to achieve waterfall effect

This article example shares the specific code of ...

Html easily implements rounded rectangle

Question: How to achieve a rounded rectangle usin...

The latest collection of 18 green style web design works

Toy Story 3 Online Marketing Website Zen Mobile I...

Detailed installation process of mysql5.7.21 under win10

This article shares the installation of MySQL 5.7...

MySQL 8.0.11 installation summary tutorial diagram

Installation environment: CAT /etc/os-release Vie...

Install Docker environment in Linux environment (no pitfalls)

Table of contents Installation Prerequisites Step...

Vue uses Baidu Maps to realize city positioning

This article shares the specific code of Vue usin...