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
Table of contents 1. JavaScript issues 2. Advanta...
In Docker's design, a container runs only one...
Table of contents 1. Prototype Relationship 2. Pr...
The overall architecture of MySQL is divided into...
Table of contents Preface: Result: 1. Polymerizat...
I usually like to visit the special pages or prod...
The VMware Workstation Pro version I use is: 1. F...
Table of contents Skeleton screen use Vue archite...
This article example shares the specific code of ...
Question: How to achieve a rounded rectangle usin...
Toy Story 3 Online Marketing Website Zen Mobile I...
This article shares the installation of MySQL 5.7...
Installation environment: CAT /etc/os-release Vie...
Table of contents Installation Prerequisites Step...
This article shares the specific code of Vue usin...