In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you "MySQL5.7.18 for Linux7.2 how to achieve binary installation", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "MySQL5.7.18 for Linux7.2 how to achieve binary installation" this article.
The specific practices are as follows:
1. Download the binary package:
Mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz
2. Add MySQL users and groups:
[root@localhost ~] # userdel mysql (because it is a new system, the existing MySQL users are deleted)
[root@localhost ~] # groupadd mysql
[root@localhost ~] # useradd-g mysql mysql
[root@localhost ~] # passwd mysql (the MySQL password should be set to be more complex, or the user should be set not to log in to the system)
3. Create the installation MySQL target and extract the software to the specified directory
[root@localhost] # mkdir-p / mysql/data
[root@localhost] # chown-R mysql.mysql / mysql
[root@localhost] # tar zxvf mysql-5.7.18-linux-glibc2.5-x86_64-C / mysql
[root@localhost ~] # cd / mysql
[root@localhost ~] # mv mysql-5.7.18-linux-glibc2.5-x86_64/ mysql5718
[root@localhost] # chown-R mysql.mysql / mysql
4. Switch MySQL users and initialize the database
[root@localhost ~] # su-mysql
[mysql@localhost] $/ mysql/mysql5718/bin/mysqld-initialize-user=mysql-basedir=/mysql/mysql5718/-datadir=/mysql/data/
-Note: initializing the database will generate a root password to log in to the MySQL database. Be sure to remember that you need to use it to log in to the database later.
5. Edit the my.cnf configuration file and start the database
[mysql@localhost ~] $vim my.cnf (this profile is for reference only)
[client]
Socket = / mysql/data/mysql.sock
Default_character_set = utf8
[mysql]
Socket=/mysql/data/mysql.sock
[mysqld]
Server_id = 1607
Port = 3306
Basedir = / mysql/mysql5718/
Datadir = / mysql/data/
Socket = / mysql/data/mysql.sock
Pid_file = / mysql/data/mysql.pid
Log_error = / mysql/data/mysql_error.log
Log_bin = / mysql/data/mysql_bin
Relay_log = / mysql/data/relay_bin
Character_set_server = utf8
Collation_server = utf8_general_ci
Innodb_buffer_pool_size = 8G
Innodb_buffer_pool_instances = 8
Innodb_log_file_size = 1G
Innodb_log_files_in_group = 3
Innodb_log_buffer_size = 24m
Innodb_flush_log_at_trx_commit = 1
Innodb_file_per_table = 1
Innodb_flush_method = O_DIRECT
Innodb_io_capacity = 200
Innodb_io_capacity_max = 600,
Innodb_thread_concurrency = 0
Innodb_autoinc_lock_mode = 2
Innodb_lock_wait_timeout = 60
Innodb_read_io_threads = 4
Innodb_write_io_threads = 4
Innodb_max_dirty_pages_pct = 80
Innodb_autoextend_increment = 512
Innodb_checksum_algorithm = NONE
Innodb_doublewrite = 0
Innodb_use_native_aio = 1
Innodb_open_files = 8192
Sync_binlog = 1
Sync_relay_log = 1
Relay_log_info_repository = TABLE
Master_info_repository = TABLE
Expire_logs_days = 10
Binlog_format = ROW
Transaction-isolation = READ-COMMITTED
Concurrent_insert = 2
Skip_slave_start = TRUE
Back_log = 2000
Thread_stack = 256k
Thread_cache_size = 256
Key_buffer_size = 256m
Tmp_table_size = 64m
Read_buffer_size = 2m
Read_rnd_buffer_size = 8m
Sort_buffer_size = 2m
Join_buffer_size = 2m
Query_cache_size = 0
Query_cache_type = 0
Max_heap_table_size = 64m
Binlog_cache_size = 2m
Table_open_cache = 8192
Max_allowed_packet = 64m
Bulk_insert_buffer_size = 64m
Max_connect_errors = 100000
Max_connections = 500,
Connect_timeout = 300
Wait_timeout = 86400
Interactive_timeout = 86400
Lower_case_table_names = 1
Open_files_limit = 20480
Skip_name_resolve
Skip_external_locking
Explicit_defaults_for_timestamp = TRUE
Sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysql@localhost] $/ mysql/mysql5718/bin/mysqld_safe-- defaults-file=/mysql/data/my.cnf-- user=mysql &
6. Enter the database to check:
[mysql@localhost] $/ mysql/mysql5718/bin/mysql-u root-p-- socket=/mysql/data/mysql.sock
Enter password:
Welcome to the MySQL monitor. Commands end with; or\ g.
Your MySQL connection id is 7
Server version: 5.7.18-log MySQL Community Server (GPL)
Copyright (c) 2000, 2017, 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='123456'; (because the password we just used is the default login password, we need to change it)
Mysql > flush privileges
Then log in to MySQL again to check
Mysql > s\
-
/ mysql/mysql5718/bin/mysql Ver 14.14 Distrib 5.7.18, for linux-glibc2.5 (x86 / 64) using EditLine wrapper
Connection id: 7
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile:''
Using delimiter:
Server version: 5.7.18-log MySQL Community Server (GPL)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. Characterset: utf8
UNIX socket: / mysql/data/mysql.sock
Uptime: 25 min 16 sec
Threads: 1 Questions: 19 Slow queries: 0 Opens: 110 Flush tables: 1 Open tables: 103 Queries per second avg: 0.012
-
Mysql >
In this way, the installation of the binary MySQL is completed successfully
These are all the contents of the article "how to implement binary installation in MySQL5.7.18 for Linux7.2". 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.