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: # 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 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:
|
<<: Detailed explanation of the data responsiveness principle of Vue
>>: 7 Best VSCode Extensions for Vue Developers
This question is a discussion among netizens in a...
This article example shares the specific code of ...
Compared with other large databases such as Oracl...
This article discusses the difficulties and ideas...
Table of contents Use of CURRENT_TIMESTAMP timest...
If this is the first time you install MySQL on yo...
0. Preparation: • Close iTunes • Kill the service...
After the server where Docker is located has been...
Table of contents Linux--File descriptor, file po...
Table of contents First look at the effect: accom...
When people are working on a backend management s...
Table of contents Preface props context state Sum...
Today I sent a small tool for Ubuntu to a custome...
<br />Hello everyone! It’s my honor to chat ...
1. Introduction to Macvlan Before the emergence o...