MySQL 5.7.17 installation and configuration tutorial under Linux (Ubuntu)

MySQL 5.7.17 installation and configuration tutorial under Linux (Ubuntu)

Preface

I have installed MySQL 5.6 before. Three months later, the developers reported that they need to process JSON data in MySQL. After checking the documentation, I found that JSON is a new feature supported in 5.7. So I started to install Mysql57
Installation of Mysql5.6.28: //www.jb51.net/article/103743.htm

Install

If you use apt-get install mysql-server to install, the default version installed is not the latest version, so consider going to the official website to find the latest community version.

1. Get the latest MySQL version

Select the operating system version (Ubuntu in this case) at https://dev.mysql.com/downloads/mysql/. When downloading, make sure it matches the operating system version (the OS version corresponds to the installation package version).

# cat /etc/issue
Ubuntu 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 the dependency report, you need to pay attention to the installation order)

# tar -xvf mysql-server_5.7.17-1ubuntu12.04_amd64.deb-bundle.tar
#ll
total 712948
drwxr-xr-x 2 root root 4096 Jan 20 10:07 ./
drwxr-xr-x 5 root root 4096 Jan 19 19:23 ../
-rw-r--r-- 1 7155 31415 1356802 Nov 29 03:30 libmysqlclient20_5.7.17-1ubuntu12.04_amd64.deb
-rw-r--r-- 1 7155 31415 1904116 Nov 29 03:30 libmysqlclient-dev_5.7.17-1ubuntu12.04_amd64.deb
-rw-r--r-- 1 7155 31415 30791660 Nov 29 03:29 libmysqld-dev_5.7.17-1ubuntu12.04_amd64.deb
-rw-r--r-- 1 7155 31415 12998 Nov 29 03:30 mysql-client_5.7.17-1ubuntu12.04_amd64.deb
-rw-r--r-- 1 7155 31415 82798 Nov 29 03:30 mysql-common_5.7.17-1ubuntu12.04_amd64.deb
-rw-r--r-- 1 7155 31415 6831 Nov 29 03:30 mysql-community_5.7.17-1ubuntu12.04_amd64.changes
-rw-r--r-- 1 7155 31415 21519804 Nov 29 03:30 mysql-community-client_5.7.17-1ubuntu12.04_amd64.deb
-rw-r--r-- 1 7155 31415 55477882 Nov 29 03:29 mysql-community-server_5.7.17-1ubuntu12.04_amd64.deb
-rw-r--r-- 1 7155 31415 208582030 Nov 29 03:30 mysql-community-source_5.7.17-1ubuntu12.04_amd64.deb
-rw-r--r-- 1 7155 31415 45244026 Nov 29 03:30 mysql-community-test_5.7.17-1ubuntu12.04_amd64.deb
-rw-r--r-- 1 7155 31415 12990 Nov 29 03:30 mysql-server_5.7.17-1ubuntu12.04_amd64.deb
-rw-r--r-- 1 root root 365015040 Nov 30 02:11 mysql-server_5.7.17-1ubuntu12.04_amd64.deb-bundle.tar
-rw-r--r-- 1 7155 31415 13014 Nov 29 03:30 mysql-testsuite_5.7.17-1ubuntu12.04_amd64.deb


###Install dependent packagessudo apt-get upgrade
sudo apt-get install libaio1
###Install the deb package sudo dpkg -i mysql-common_5.7.17-1ubuntu12.04_amd64.deb
sudo dpkg -i libmysqlclient20_5.7.17-1ubuntu12.04_amd64.deb
sudo dpkg -i libmysqlclient-dev_5.7.17-1ubuntu12.04_amd64.deb
sudo dpkg -i libmysqld-dev_5.7.17-1ubuntu12.04_amd64.deb
sudo dpkg -i mysql-community-client_5.7.17-1ubuntu12.04_amd64.deb
sudo dpkg -i mysql-client_5.7.17-1ubuntu12.04_amd64.deb
sudo dpkg -i mysql-community-source_5.7.17-1ubuntu12.04_amd64.deb

###libmecab2 installationsudo 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 the previous 5.6 version)

1. Add new users and empower them

create user testuser identified by '*******';
create database testdb;
GRANT ALL ON testdb.* TO 'testuser'@'%';
flush privileges;

--Open remote access rights for root user mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> 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. Configuration file modification

Configuration file path (changed from previous versions, 56 path: /etc/MySQL/my.conf)
57 Path: /etc/mysql/mysql.conf.d/mysqld.cnf

--Bind IP modification. Find the line bind-address = 127.0.0.1 and change it to bind-address = 0.0.0.0. The problem is solved.
--Case-sensitive modification
Add lower_case_table_names=1 after [mysqld], restart the MYSQL service, and the setting is successful: table names are not case sensitive;
Detailed explanation of the lower_case_table_names parameter:
lower_case_table_names = 0
0: case sensitive, 1: case insensitive

other

The basic service start and stop commands have not changed

# Start MySQL$ sudo service mysql start 
# Shut down 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

Wonderful topic sharing:

MySQL different versions installation tutorial

MySQL 5.6 installation tutorials for various versions

MySQL 5.7 installation tutorials for various versions

mysql8.0 installation tutorials for various versions

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 MySQL 5.7 on Ubuntu 18.04
  • Ubuntu16.04 installation mysql5.7.22 graphic tutorial
  • Solve the problem of ERROR 1045 (28000): Access denied for user ''root''@''localhost'' when logging in after installing MySQL 5.7.17 on Ubuntu 16.04
  • Manually install mysql5.7.10 on Ubuntu
  • MySQL 5.7.17 installation and configuration method graphic tutorial (Ubuntu 16.04)
  • Detailed tutorial on installing and configuring MySql5.7 on Ubuntu 20.04

<<:  Detailed explanation of Linux file operation knowledge points

>>:  Vue uses filters to format dates

Recommend

Introduction to version management tool Rational ClearCase

Rational ClearCase is a software configuration ma...

js canvas realizes rounded corners picture

This article shares the specific code of js canva...

How to install ROS Noetic in Ubuntu 20.04

Disclaimer: Since the project requires the use of...

Mysql some complex sql statements (query and delete duplicate rows)

1. Find duplicate rows SELECT * FROM blog_user_re...

JS removeAttribute() method to delete an attribute of an element

In JavaScript, use the removeAttribute() method o...

How to install mysql6 initialization installation password under centos7

1. Stop the database server first service mysqld ...

A brief discussion of 3 new features worth noting in TypeScript 3.7

Table of contents Preface Optional Chaining Nulli...

Example of setting up a whitelist in Nginx using the geo module

Original configuration: http { ...... limit_conn_...

Code to display the contents of a txt book on a web page

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML ...

A super detailed Vue-Router step-by-step tutorial

Table of contents 1. router-view 2. router-link 3...

Test and solution for MySQL's large memory usage and high CPU usage

After the changes: innodb_buffer_pool_size=576M -...

Java programming to write a JavaScript super practical table plug-in

Table of contents Effects Documentation first ste...

Detailed process of compiling and installing Storm on Kylin V10 server

1 Introduction Apache Storm is a free, open sourc...

uniapp dynamic modification of element node style detailed explanation

Table of contents 1. Modify by binding the style ...