Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The latest method of installing mysql 5.7.19 in binary mode

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Let me tell you a little bit about the latest way to install mysql 5.7.19 in binary mode. Have you learned about similar topics before? If you are interested, let's take a look at this article. I believe it will be of some help to you after reading the latest method of binary installation of mysql 5.7.19.

I. Optimization part

1. Operating system parameter tuning

two。 Database parameter tuning

3. Firewall settings, etc.

# #

II. Installation part

1. Create users and groups

# groupadd mysql

# useradd-g mysql mysql

two。 Create database installation directory, authorization

# mkdir / mysql/ mysql/data / mysql/log

# chown-R mysql:mysql / usr/local/mysql

3. Go to the installation directory and extract the installation files

# 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. View default password

Grep-I password / mysql/log/mysql-error.log

11. Initialize password

Mysql-uroot-pendant xxxxxxx'

SET PASSWORD=PASSWORD ('root')

Flush privileges

twelve。 General database startup and shutdown

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

What do you think of the latest method of binary installation of mysql 5.7.19? what do you think of this article and whether it has gained anything? If you want to know more about it, you can continue to follow our industry information section.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report