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

Detailed configuration of mysql8.x docker remote access

Table of contents Environmental conditions Errors...

How to configure domestic sources in CentOS8 yum/dnf

CentOS 8 changed the software package installatio...

How to import/save/load/delete images locally in Docker

1. Docker imports local images Sometimes we copy ...

Master-slave synchronization configuration of Mysql database

Table of contents Mysql master-slave synchronizat...

Nginx's practical method for solving cross-domain problems

Separate the front and back ends and use nginx to...

7 Ways to Write a Vue v-for Loop

Table of contents 1. Always use key in v-for loop...

CentOS IP connection network implementation process diagram

1. Log in to the system and enter the directory: ...

Provides helpful suggestions for improving website design

<br />Scientifically Design Your Website: 23...

CentOS 6 Compile and install ZLMediaKit analysis

Install ZLMediaKit on centos6 The author of ZLMed...

Vue component communication method case summary

Table of contents 1. Parent component passes valu...

Chinese website user experience rankings

<br />User experience is increasingly valued...