mysql 5.7.19 latest binary installation

mysql 5.7.19 latest binary installation

First download the zip archive version from the official website http://dev.mysql.com/downloads/mysql/

MySQL v5.7.19 official version (32/64 bit installation version and zip decompression version)

1. Optimization

1. Operating system parameter tuning

2. Database parameter tuning

3. Firewall settings, etc.

#############################

2. Installation

1. Create users and groups

# groupadd mysql
# useradd -g mysql mysql

2. Create database installation directory and authorization

# mkdir /mysql /mysql/data /mysql/log 
# chown -R mysql:mysql /usr/local/mysql

3. Go to the installation directory and unzip the installation file

#cd /usr/local
# tar -zxvf mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz
# mv mysql-5.7.19-linux-glibc2.12-x86_64 mysql

4. Authorization

# chown -R mysql.mysql mysql

5. Verify permissions

# ls -l mysql
total 52
drwxr-xr-x 2 mysql mysql 4096 Aug 8 04:06 bin
-rw-r--r-- 1 mysql mysql 17987 Jun 22 22:13 COPYING
drwxr-xr-x 2 mysql mysql 4096 Aug 8 04:06 docs
drwxr-xr-x 3 mysql mysql 4096 Aug 8 04:06 include
drwxr-xr-x 5 mysql mysql 4096 Aug 8 04:06 lib
drwxr-xr-x 4 mysql mysql 4096 Aug 8 04:06 man
-rw-r--r-- 1 mysql mysql 2478 Jun 22 22:13 README
drwxr-xr-x 28 mysql mysql 4096 Aug 8 04:06 share
drwxr-xr-x 2 mysql mysql 4096 Aug 8 04:06 support-files

6. Edit parameter file

vim /etc/my.cnf
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
server_id=10
port = 3306
user = mysql
character-set-server = utf8mb4
default_storage_engine = innodb
log_timestamps = SYSTEM
socket = /tmp/mysql.sock
basedir = /usr/local/mysql
datadir = /mysql/data
pid-file = /mysql/data/mysql.pid
max_connections = 1000
max_connect_errors = 1000
table_open_cache = 1024
max_allowed_packet = 128M
open_files_limit = 65535
#####=====================================[innodb]===============================
innodb_buffer_pool_size = 1024M
innodb_file_per_table = 1
innodb_write_io_threads = 4
innodb_read_io_threads = 4
innodb_purge_threads = 2
innodb_flush_log_at_trx_commit = 1
innodb_log_file_size = 512M
innodb_log_files_in_group = 2
innodb_log_buffer_size = 16M
innodb_max_dirty_pages_pct = 80
innodb_lock_wait_timeout = 30
innodb_data_file_path=ibdata1:1024M:autoextend
innodb_undo_tablespaces=3
#####======================================[log]================================
log_error = /mysql/log/mysql-error.log 
slow_query_log = 1
long_query_time = 1 
slow_query_log_file = /mysql/log/mysql-slow.log
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

7. Install the database

# ./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/mysql/data --innodb_undo_tablespaces=3 --explicit_defaults_for_timestamp

8. Configure the startup file

cp support-files/mysql.server /etc/init.d/mysql
chkconfig --add mysql
chkconfig mysql on
service mysql start

9. Configure environment variables

vi /etc/profile
#for mysql 
mysql_home=/usr/local/mysql
PATH=$PATH:$mysql_home/bin
source /etc/profile

10. Check the default password

grep -i password /mysql/log/mysql-error.log

11. Initialize password

mysql -uroot -p'xxxxx'
SET PASSWORD=PASSWORD('root');
flush privileges;

12. Regular start and stop of database

# mysqladmin -uroot -proot shutdown
#mysqld_safe --defaults-file=/etc/my.cnf &
#ps -ef|grep mysql

13. Security Configuration

#mysql_secure_installation 
Securing the MySQL server deployment.
Enter password for user root: 
VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?
Press y|Y for Yes, any other key for No: y
There are three levels of password validation policy:
LOW Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2
Using existing password for root.
Estimated strength of the password: 25 
Change the password for root ? ((Press y|Y for Yes, any other key for No) : y
New password: 
Re-enter new password: 
Sorry, passwords do not match.
New password: 
Re-enter new password: 
Sorry, passwords do not match.
New password: 
Re-enter new password: 
Estimated strength of the password: 50 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
 ... Failed! Error: Your password does not satisfy the current policy requirements
New password: 
Re-enter new password: 
Estimated strength of the password: 100 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.
Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
Success.
 - Removing privileges on test database...
Success.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.
All done!

Related reading:

Mysql installation tutorials in various systems

Detailed tutorial on configuration method of Mysql 5.7.19 free installation version (64-bit)

Mysql 5.7.19 free installation version encountered pitfalls (collection)

How to create a my.ini file in the MySQL 5.7.19 installation directory

Summarize

The above is the latest binary installation of MySQL 5.7.19 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • MySQL 5.7.18 binary package installation tutorial under Linux (without default configuration file my_default.cnf)
  • Deploy MySQL 5.7.17 binary installation and multi-instance configuration on CentOS 6.5
  • Detailed tutorial on customizing the installation path of MySQL 5.7.18 version (binary package installation)
  • How to install mysql5.7.24 binary version on Centos 7 and how to solve it
  • Centos7.5 installs mysql5.7.24 binary package deployment
  • Detailed tutorial on installing MySQL 5.7.11 for Linux Generic binary version in CentOS 7 via command line
  • Tutorial on installing MySQL 5.6.20 using Linux binary universal package
  • Install mysql5.6 in ubuntu system (through binary)
  • MySQL 5.6.24 (binary) automatic installation script under Linux
  • The whole process record of MySQL binary installation and backup

<<:  Correct modification steps for Docker's default network segment

>>:  How to use docker to deploy front-end applications

Recommend

Sharing the structure and expression principles of simple web page layout

Introduction to structure and performance HTML st...

Detailed explanation of using scp command to copy files remotely in Linux

Preface scp is the abbreviation of secure copy. s...

Implementation of running SQL Server using Docker

Now .net core is cross-platform, and everyone is ...

WeChat applet implements user login module server construction

I chose node.js to build the server. Friends who ...

Comprehensive understanding of HTML basic structure

Introduction to HTML HyperText Markup Language: H...

Element uses scripts to automatically build new components

Table of contents background How does element-ui&...

How to query duplicate data in mysql table

INSERT INTO hk_test(username, passwd) VALUES (...

Linux kernel device driver Linux kernel basic notes summary

1. Linux kernel driver module mechanism Static lo...

MySQL 8.0.22 winx64 installation and configuration graphic tutorial

mysql 8.0.22 winx64 installation and configuratio...

Understand the implementation of Nginx location matching in one article

Since the team is separating the front-end and ba...

Detailed explanation of the construction and use of docker private warehouse

1. Download the repository image docker pull regi...

Configure Mysql master-slave service implementation example

Configure Mysql master-slave service implementati...