Tutorial on installing and configuring mysql5.7.17 in Linux (Ubuntu), ubuntumysql5.7.17
Preface
Mysql5.6 was installed earlier. After three months, the development team reported that JSON data needs to be processed in MySQL. view the document. JSON is a new feature supported in MySQL 5.7. So I started to install Mysql57.
Installation of Mysql5.6.28: http://www.bkjia.com/article/103743.htm
Install
If apt-get install mysql-server is used for installation, the latest version is not installed by default. Therefore, go to the official website to find the latest Community version.
1. obtain the latest Mysql version
Select the operating system version (Ubuntu in this example) under the https://dev.mysql.com/downloads/mysql/, pay attention to the download should match the operating system version (OS version corresponds to the installation package version ).
# cat /etc/issueUbuntu 12.04.5 LTS \n \l# wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-server_5.7.17-1ubuntu12.04_amd64.deb-bundle.tar
2. Specific installation (due to dependency reports, pay attention to the installation order)
# Tar-xvf mysql-server_5.7.17-1ubuntu12.04_amd64.deb-bundle.tar # lltotal 712948drwxr-xr-x 2 root 4096 Jan 20. /drwxr-xr-x 5 root 4096 Jan 19 .. /-rw-r -- 1 7155 31415 1356802 Nov 29 libmysqlclient20_5.7.17-1ubuntu12.04_amd64.deb-rw-r -- r -- 1 7155 31415 1904116 Nov 29 libmysqlclient-dev_5.7.17-1ubuntu12.04_amd64.deb-rw-r -- r -- 1 7155 31415 30791660 Nov 29 libmysqld-dev_5.7.17-1ubuntu12.04_amd64.deb-rw-r -- r -- 1 7155 31415 12998 Nov 29 mysql-client_5.7.17-1ubuntu12.04_amd64.deb-rw-r -- r -- 1 7155 31415 82798 Nov 29 mysql-common_5.7.17-1ubuntu12.04_amd64.deb-rw-r -- r -- 1 7155 31415 6831 Nov 29 mysql-community_5.7.17-1ubuntu12.04_amd64.changes-rw-r -- r -- 1 7155 31415 21519804 Nov 29 mysql-community-client_5.7.17-1ubuntu12.04_amd64.deb-rw-r -- r -- 1 7155 31415 55477882 Nov 29 mysql-community-server_5.7.17-1ubuntu12.04_amd64.deb-rw-r -- r -- 1 7155 31415 208582030 Nov 29 mysql-community-source_5.7.17-1ubuntu12.04_amd64.deb-rw-r -- r -- 1 7155 31415 45244026 Nov 29 mysql-community-test_5.7.17-1ubuntu12.04_amd64.deb-rw-r -- r -- 1 7155 31415 12990 Nov 29 mysql-server_5.7.17-1ubuntu12.04_amd64.deb-rw-r -- r -- 1 root 365015040 Nov 30 mysql-server_5.7.17-1ubuntu12.04_amd64.deb-bundle.tar-rw-r -- r -- 1 7155 31415 13014 Nov 29 mysql-testsuite_5.7.17-1ubuntu12.04_amd64.deb ### install dependency package sudo apt-get upgradesudo apt -get install libaio1 ### install deb package sudo dpkg-I mysql-common_5.7.17-1ubuntu12.04_amd64.debsudo dpkg-I libmysqlclient20_5.7.17-1ubuntu12.04_amd64.debsudo dpkg-I libmysqlclient-dev_5.7.17-1ubuntu12.04_amd64.debsudo dpkg-I libmysqld-dev_5.7.17-1ubuntu12.04_amd64.debsudo dpkg-I mysql-community-client_5.7.17-1ubuntu12.04_amd64.debsudo dpkg-I mysql-client_5.7.17-1ubuntu12.04_amd64.debsudo dpkg-I mysql-community-source_5.7.17-1ubuntu12.04_amd64.deb # # libmecab2 install sudo apt-get-f install sudo dpkg-I mysql-community-server_5.7.17-1ubuntu12.04_amd64.deb ### you will be prompted to set the root password
Basic configuration (different from previous 5.6 versions)
1. Add users and grant permissions
Create user testuser identified by '********'; create database testdb; grant all on testdb. * TO 'testuser' @ '%'; flush privileges; -- the root user can access mysql> use mysql remotely; reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with-ADatabase changedmysql> select host, user from user; + ----------- + | host | user | + ----------- + | % | testuser | localhost | mysql. sys | localhost | root | + ----------- + 3 rows in set (0.00 sec) mysql> update user set host = '%' where user = 'root'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> select host, user from user; + ----------- + | host | user | + ----------- + | % | testuser | |%| root | localhost | mysql. sys | + ----------- + 3 rows in set (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec)
2. modify the configuration file
Configuration file path (changed compared with the previous version, 56 path:/etc/MySQL/my. conf)
57 path:/etc/mysql. conf. d/mysqld. cnf
-- Bind IP address to modify
Find bind-address = 127.0.0.1.
Change bind-address = 0.0.0.0 to solve the problem.
-- Case Sensitive Modification
[Mysqld] And then add lower_case_table_names = 1 to restart the MYSQL service. The settings are successful: Case Insensitive to table names;
Lower_case_table_names parameters:
Lower_case_table_names = 0
0: Case Sensitive, 1: case insensitive
Others
The basic service stop and stop commands remain unchanged.
# Start MySQL $ sudo service mysql start # Close MySQL $ sudo service mysql stop # restart MySQL $ sudo service mysql restart # other commands: $ sudo/etc/init. d/mysql start $ sudo/etc/init. d/mysql stop $ sudo/etc/init. d/mysql restart
Highlights: mysql installation tutorials for different versions mysql5.7 installation tutorials for various versions mysql5.6 installation tutorials
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.