MySQL 5.7.192 binary Latest Installation

Source: Internet
Author: User

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

2017-08-08 notes

First, optimize the part

1. Tuning of operating system parameters

2. Database Parameter tuning

3. Firewall settings, etc.

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

Second, the installation part

1. Create users and Groups

# Groupadd MySQL

# useradd-g MySQL MySQL


2. Create a Database installation directory, authorization

# Mkdir/mysql/mysql/data/mysql/log

# Chown-r Mysql:mysql/usr/local/mysql


3. To the installation directory, 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 8 04:06 bin

-rw-r--r--1 MySQL MySQL 17987 June 22:13 COPYING

Drwxr-xr-x 2 mysql mysql 4096 8 04:06 docs

Drwxr-xr-x 3 MySQL mysql 4096 8 04:06 include

Drwxr-xr-x 5 mysql MySQL 4096 8 04:06 Lib

Drwxr-xr-x 4 mysql mysql 4096 8 04:06 man

-rw-r--r--1 MySQL MySQL 2478 June 22:13 README

drwxr-xr-x MySQL mysql 4096 8 04:06 share

Drwxr-xr-x 2 mysql mysql 4096 8 04:06 support-files


6. Edit the 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 Boot 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. View 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. Database regular Start-stop

# 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 is

Secure enough. Would do you like to setup VALIDATE PASSWORD plugin?


Press y| Y for Yes, any and key for No:y


There is 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, and key for No): Y


New Password:


Re-enter new password:

Sorry, passwords does not match.


New Password:


Re-enter new password:

Sorry, passwords does 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, and 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, and key for No): Y

By default, a MySQL installation have an anonymous user,

Allowing anyone to log into MySQL without has

A user account created for them. This was 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, and key for No): Y

Success.



Normally, Root should only is allowed to connect from

' localhost '. This ensures, someone cannot guess at

The root password from the network.


Disallow Root login remotely? (Press y| Y for Yes, any, and key for No): Y

Success.


By default, MySQL comes with a database named ' Test ' that

Anyone can access. This was 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, and key for No): Y

-Dropping test database ...

Success.


-Removing privileges on test database ...

Success.


Reloading the privilege tables would ensure that all changes

Made so far would take effect immediately.


Reload privilege tables now? (Press y| Y for Yes, any, and key for No): Y

Success.


All done!


This article is from the "ROIDBA" blog, make sure to keep this source http://roidba.blog.51cto.com/12318731/1954372

MySQL 5.7.192 binary Latest Installation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.