In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you Percona MySQL 5.7 Linux how to install the general binary package, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's learn about it!
MySQL is dependent on the libaio library, and without this package, data directory initialization and subsequent service startup will fail.
Yum install libaio
Create a software installation directory
Mkdir / mysql_software_57
Download software
The download page of the Percona official website has two binary Tar packages, corresponding to different distributions.
Ssl100-Debian/Ubuntu
Ssl101-for CentOS 6 and CentOS 7
Cd / mysql_software
Wget https://www.percona.com/downloads/Percona-Server-5.7/Percona-Server-5.7.17-11/binary/tarball/Percona-Server-5.7.17-11-Linux.x86_64.ssl101.tar.gz
Extract the installation package
[root@localhost mysql_software_57] # tar xvfz Percona-Server-5.7.17-11-Linux.x86_64.ssl101.tar.gz
[root@localhost mysql_software_57] # ls
Percona-Server-5.7.17-11-Linux.x86_64.ssl101
Percona-Server-5.7.17-11-Linux.x86_64.ssl101.tar.gz
[root@localhost mysql_software_57] # rm-rf Percona-Server-5.7.17-11-Linux.x86_64.ssl101.tar.gz
[root@localhost mysql_software_57] # ls
Percona-Server-5.7.17-11-Linux.x86_64.ssl101
[root@localhost mysql_software_57] # mv Percona-Server-5.7.17-11MelLinux.x86x64.ssl101Universe *.
[root@localhost mysql_software_57] # rmdir Percona-Server-5.7.17-11-Linux.x86_64.ssl101/
Create a mysql user
[root@localhost ~] # groupadd mysql
[root@localhost] # useradd-r-g mysql-s / bin/false mysql
Create a data directory and log directory
[root@localhost mysql_software_57] # mkdir / mysql_data_57
[root@localhost mysql_software_57] # mkdir / mysql_log_57
[root@localhost mysql_software_57] # chmod 750 / mysql_data_57/
[root@localhost mysql_software_57] # chown-R mysql.mysql / mysql_data_57/
[root@localhost mysql_software_57] # chown-R mysql.mysql / mysql_log_57/
Edit configuration file
[root@localhost mysql_software_57] # vim / etc/my.cn
Click (here) to collapse or open
[client]
Port = 3306
Socket = / mysql_data_57/mysql.sock
[mysqld]
# MySQL Server layer basic setting
Server-id = 1
Port = 3306
Socket = / mysql_data_57/mysql.sock
# MySQL Server layer directory setting
Basedir = / mysql_software_57
Datadir = / mysql_data_57
Tmpdir = / mysql_data_57
# MySQL Server layer connection setting
Max_connections = 900,
# MySQL Server layer connection setting
Max_connections = 900,
Max_connect_errors = 100000
Max_allowed_packet = 16m
Back_log = 50
# MySQL Server layer binlog setting
Log_bin_trust_function_creators = on
Expire_logs_days = 5
Binlog_cache_size = 1m
Log-bin = / mysql_log_57/mysql-bin
Binlog_format = mixed
# MySQL Server layer memory management setting
Tmp_table_size = 64m
Max_heap_table_size = 64m
Read_buffer_size = 2m
Read_rnd_buffer_size = 16m
Sort_buffer_size = 8m
Join_buffer_size = 16m
Query_cache_size = 0
Thread_stack = 19K
Query_cache_size = 0
Thread_stack = 19K
# MySQL Server layer transaction management setting
Transaction_isolation = READ-COMMITTED
Autocommit = OFF
# MySQL Server layer log related setting
Log_warnings = 2 # # this value have been the default value in MySQL 5.7
Slow_query_log = ON
Long_query_time = 2
Slow_query_log_file = / mysql_log_57/mysql-slow.log
# log_queries_not_using_indexes = 1
# MySQL Server layer other behaviour setting
Sql_mode = PIPES_AS_CONCAT,IGNORE_SPACE,STRICT_TRANS_TABLES
Event_scheduler = ON
Lower_case_table_names = 1
Explicit_defaults_for_timestamp = ON
Default-storage-engine = INNODB
Explicit_defaults_for_timestamp = ON
Default-storage-engine = INNODB
# # ft_min_word_len = 4
# Statistic
# userstat = ON
# thread_statistics = ON
# End statistics
# MyISAM Engine related setting
Key_buffer_size = 32m
Bulk_insert_buffer_size = 64m
Myisam_sort_buffer_size = 128m
Myisam_max_sort_file_size = 10G
Myisam_repair_threads = 1
# myisam_recover
# InnoDB Engine related setting
# InnoDB memory management related setting
Innodb_buffer_pool_size = 2G
Innodb_max_dirty_pages_pct = 90
Innodb_sync_array_size = 16
Innodb_max_dirty_pages_pct = 90
Innodb_sync_array_size = 16
# table open cache related
Table_open_cache = 4096
Table_open_cache_instances = 16
# innodb_additional_mem_pool_size = 16m # # This variable have been removed MySQL 5.7m
# innodb_numa_interleave = 1 # # Only work with Percona 5.6.27 and later
# # InnoDB engine I/O related setting
Innodb_write_io_threads = 8
Innodb_read_io_threads = 8
Innodb_flush_method = O_DIRECT
# InnoDB engine File management related setting
Innodb_data_file_path = ibdata1:12M:autoextend # 10m-> 12m, 12m is default values, it is meaningless to set it to 10m
Innodb_file_per_table = 1 # this value have been the default value in MySQL 5.7
Innodb_data_file_path = ibdata1:12M:autoextend # 10m-> 12m, 12m is default values, it is meaningless to set it to 10m
Innodb_file_per_table = 1 # this value have been the default value in MySQL 5.7
Innodb_file_format = Barracuda # this value have been the default value in MySQL 5.7
# InnoDB engine undo log related setting
Innodb_undo_directory = / mysql_data_57
Innodb_undo_tablespaces = 4
Innodb_purge_batch_size = 5000
Innodb_purge_threads = 8
# InnoDB engine redo log related setting
Innodb_flush_log_at_trx_commit = 2
Innodb_log_buffer_size = 8m
Innodb_log_file_size = 256m
Innodb_log_files_in_group = 3
Innodb_log_group_home_dir = / mysql_log_57
# InnoDB engine lock and transaction management setting
Innodb_lock_wait_timeout = 120
Innodb_lock_wait_timeout = 120
# InnoDB engine other behaviour setting
Innodb_large_prefix = ON # # this value have been the default value in MySQL 5.7
Innodb_strict_mode = ON # # this value have been the default value in MySQL 5.7
Innodb_checksum_algorithm = crc32 # # this value have been the default value in MySQL 5.7
[mysqldump]
Quick
Max_allowed_packet = 16m
[mysql]
No-auto-rehash
# Only allow UPDATEs and DELETEs that use keys.
# safe-updates
[myisamchk]
Key_buffer_size = 512m
Sort_buffer_size = 512m
Key_buffer_size = 512m
Sort_buffer_size = 512m
Read_buffer = 8m
Write_buffer = 8m
[mysqlhotcopy]
Interactive-timeout
[mysqld_safe]
# Increase the amount of open files allowed per process. Warning: Make
# sure you have set the global system limit high enough! The high value
# is required for a large number of opened tables
Open-files-limit = 8192
Log-error = / mysql_log_57/mysqld_error.log
Initialize the data file path of the MySQL database and create the system table
5.7.6 and above, use mysqld to initialize the database
[root@localhost mysql_software_57] # bin/mysqld-defaults-file=/etc/my.cnf-initialize-insecure-user=mysql
...
2017-04-02T07:54:13.022906Z 0 [Note] Shutting down slave threads
2017-04-02T07:54:13.022915Z 0 [Note] Forcefully disconnecting 0 remaining clients
2017-04-02T07:54:13.068736Z 0 [Note] Binlog end
2017-04-02T07:54:13.072400Z 0 [Note] InnoDB: FTS optimize thread exiting.
2017-04-02T07:54:13.072548Z 0 [Note] InnoDB: Starting shutdown...
2017-04-02T07:54:13.173584Z 0 [Note] InnoDB: Dumping buffer pool (s) to / mysql_data_57/ib_buffer_pool
2017-04-02T07:54:13.174062Z 0 [Note] InnoDB: Buffer pool (s) dump completed at 170402 0:54:13
2017-04-02T07:54:14.956340Z 0 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
2017-04-02T07:54:16.679052Z 0 [Note] InnoDB: Shutdown completed; log sequence number 2411492
2017-04-02T07:54:16.679587Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
Start the database
[root@localhost mysql_software_57] # bin/mysqld_safe-- defaults-file=/etc/my.cnf &
[root@localhost mysql_software_57] # 2017-04-02T08:02:36.065640Z mysqld_safe Logging to'/ mysql_log_57/mysqld_error.log'.
2017-04-02T08:02:36.068876Z mysqld_safe error: log-error set to'/ mysql_log_57/mysqld_error.log', however file don't exists. Create writable for user 'mysql'.
[1] + Exit 1 bin/mysqld_safe-- defaults-file=/etc/my.cnf
There is no error in the log file. Create the log file manually
[root@localhost mysql_log_57] # su-mysql
[mysql@localhost ~] $cd / mysql_log_57/
[mysql@localhost mysql_log_57] $touch mysqld_error.log
Start the database again
[root@localhost mysql_software_57] # bin/mysqld_safe-- defaults-file=/etc/my.cnf &
[1] 37100
[root@localhost mysql_software_57] # 2017-04-02T08:03:44.853263Z mysqld_safe Logging to'/ mysql_log_57/mysqld_error.log'.
2017-04-02T08:03:44.857901Z mysqld_safe Logging to'/ mysql_log_57/mysqld_error.log'.
2017-04-02T08:03:44.922034Z mysqld_safe Starting mysqld daemon with databases from / mysql_data_57
Change the root password
[root@localhost mysql_software_57] # bin/mysql-uroot-p
Enter password:
Welcome to the MySQL monitor. Commands end with; or\ g.
Your MySQL connection id is 4
Server version: 5.7.17-11-log Percona Server (GPL), Release 11, Revision f60191c
Copyright (c) 2009-2016 Percona LLC and/or its affiliates
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.
Mysql > set password = password ('root')
Query OK, 0 rows affected, 1 warning (0.01 sec)
Mysql > flush privileges
Query OK, 0 rows affected (0.00 sec)
These are all the contents of the article "how to install binary packages for Percona MySQL 5.7Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.