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

How to install mysql5.7.18.tar.gz offline by centos7.2

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article is about how centos7.2 installs mysql5.7.18.tar.gz offline. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Mysql cannot be installed using yum because of network isolation. Here is how to manually install mysql off-line on a linux server.

Purpose

Install the mysql service offline

Server: centos7.2, configuring local yum source

Mysql version: mysql5.7.18

Steps

1. Download the installation package mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz and transfer the installation package to the destination server / tmp directory

The 2.my.cnf file (see bottom) is transferred to the / tmp directory of the destination server

3. Create the user and the appropriate folder:

# preparegroupadd mysqluseradd-r-g mysql-s / bin/false mysqlyum install-y autoconfmkdir / appsmkdir / logsmkdir / datamkdir-p / data/mysql7006/data & & chown-R mysql:mysql / data/mysql7006mkdir / logs/mysql7006 & & chown-R mysql:mysql / logs/mysql7006touch / logs/mysql7006/error-log.err & & chown-R mysql:mysql / logs/mysql7006/error-log.err

4. Installation

Cd / tmptar zxvf mysql-5.7.18-linux-glibc2.5-x86_64.tar.gzmv mysql-5.7.18-linux-glibc2.5-x86_64 mysqlmv mysql/ apps/mysqlcp my.cnf / apps/mysql/chown-R mysql:mysql / apps/mysql/# initializes database, cd / apps/mysql./bin/mysqld-- initialize-- user=mysql-- basedir=/apps/mysql/-- datadir=/data/mysql7006/data/

A default password will be generated during initialization. Remember to write it down and use it for subsequent modifications.

5. Register for service (you don't have to do it)

# modify support-files/mysql.servercp support-files/mysql.server / etc/init.d/mysqlsystemctl start mysql.service# to add boot chkconfig mysql.server on according to the situation

6. Start the database / apps/mysql/bin/mysqld_safe-- defaults-file=/apps/mysql/my.cnf &

7. Change the default password:

/ apps/mysql/bin/mysqladmin-u root password' password'-- port=7006-- socket=/data/mysql7006/mysql.sock-p # clear the history record of linux after modification history-c # login test: / apps/mysql/bin/mysql-u root-- port=7006-- socket=/data/mysql7006/mysql.sock-p

8. Firewalls, empowerment (on demand)

# Firewall firewall-cmd-- zone=public-- add-port=7006/tcp-- permanentsystemctl restart firewalldfirewall-cmd-- zone=public-- query-port=7006/tcp# entitles login users to use mysql;grant all privileges on *. * to user@'ip' identified by "password"; flush privileges;select host,user,password from user

9. Login with a hidden password locally (you don't have to do it)

# # create a login file using mysql_config_editor / apps/mysql/bin/mysql_config_editor set-- login-path=root_pass-- user=root-- port=7006-- socket=/data/mysql7006/mysql.sock-- password## enter the password: * # # the file will be encrypted and stored in the user's root directory. Mylogin.c nf/apps/mysql/bin/mysql_config_editor print-- the next time all## logs in, directly tap: / Apps/mysql/bin/mysql-- login-path=root_pass# is a little easier: set alias# opens file .bashrc Add alias db7006='/apps/mysql/bin/mysql-- login-path=root_pass'# and exit execution: source .bashrc # # the next time you log in, just type: db7006

Appendix

My.cnf file

Main functions: global utf8 character set, custom port, data folder, log folder, default engine innodb (supporting transactions, xtrabackup-friendly), skipping dns parsing during client login

[client] port=7006default-character-set=utf8 [mysqld] skip-name-resolvesecure_file_priv= "/" character-set-server=utf8user=mysqlserver_id=20180917port=7006socket=/data/mysql7006/mysql.sockpid-file=/data/mysql7006/mysql.pidbasedir=/apps/mysqldatadir=/data/mysql7006/datalog-error=/logs/mysql7006/error-loglog-bin=/logs/mysql7006/bin-logmax_allowed_packet = 64Mdefault_storage_engine = InnoDBinnodb_strict_mode = 1innodb_buffer_pool_size = 5Ginnodb_stats_on_metadata = 0innodb_file_format = Barracudainnodb_flush_method = O_DIRECTinnodb_log_files_in_group = 2innodb_log_file_size = 4Ginnodb_log_buffer_size = 128Minnodb_file_per_table = 1innodb_max_dirty_pages_pct = 60innodb_io_capacity = 4000lower_case_table_names = 1#ADD INNODBinnodb_buffer_pool_instances = 16innodb_flush_log_at_trx_commit = 1innodb_adaptive_flushing = 1innodb_thread_concurrency = 0innodb_stats_persistent = 1innodb_purge_threads = 4innodb_use_native_aio = 1##innodb_use_sys_malloc = 1innodb_autoinc_lock_mode = 2innodb_change_buffering = insertsinnodb_read_io_threads = 16innodb_write_io_threads = 16expire_logs_days = 3percent CACHES AND LIMITS # key_buffer_size = 32Mtmp_table_size = 256Mmax_heap_table_size = 256Mtable_open_cache = 4096query_cache_type = 0query_cache_size = 0max_connections = 2000thread_cache_size = 1024open_files_limit = 65535#ADD OTHERSmetadata_locks_hash_instances = 256table_open_cache_instances = 16back_log = 1500wait_timeout = 3600interactive_timeout = 3600master_info_repository=TABLErelay_log_info_repository=TABLElog_slave_updates=ONbinlog_checksum=NONEbinlog_format=ROWtransaction_isolation=READ-COMMITTEDsql_mode='STRICT_TRANS_TABLES NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION', thank you for your reading! This is the end of the article on "how to install mysql5.7.18.tar.gz offline in centos7.2". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

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