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

Vue implements real-time refresh of the time display in the upper right corner

This article example shares the specific code of ...

Introduction to Enterprise Production MySQL Optimization

Compared with other large databases such as Oracl...

Implementation of CSS linear gradient concave rectangle transition effect

This article discusses the difficulties and ideas...

How to use CURRENT_TIMESTAMP in MySQL

Table of contents Use of CURRENT_TIMESTAMP timest...

How to modify iTunes backup path under Windows

0. Preparation: • Close iTunes • Kill the service...

Solve the problem of insufficient docker disk space

After the server where Docker is located has been...

Details of Linux file descriptors, file pointers, and inodes

Table of contents Linux--File descriptor, file po...

HTML+CSS+JS realizes the scrolling gradient effect of the navigation bar

Table of contents First look at the effect: accom...

Sample code for implementing menu permission control in Vue

When people are working on a backend management s...

Exploration of three underlying mechanisms of React global state management

Table of contents Preface props context state Sum...

Linux bash: ./xxx: Unable to execute binary file error

Today I sent a small tool for Ubuntu to a custome...

How to Apply for Web Design Jobs

<br />Hello everyone! It’s my honor to chat ...

Implementation of Docker cross-host network (manual)

1. Introduction to Macvlan Before the emergence o...