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

Installation of MySQL-5.7.19 under CentOs6.5 system

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

Share

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

It has not been updated for a long time. Today, I would like to share with you a wave of simple documents. The beginner spirit of a rookie is to keep learning and seek help from God!

Today, I would like to recommend a blog address: http://sumongodb.blog.51cto.com/.

Okay! Cut the crap and get to work!

The mysql5.7.19 binary installation under CentOs6.5 is the official source package compiled by myself.

First, let's install some dependency packages:

Yum-y groupinstall "Development tools" yum-y install ncurses ncurses-devel openssl-devel bison gcc gcc-c++ make

Extract the mysql binary installation package:

Tar-zxvf mysql-5.7.19.tar.gz-C / usr/local/mysql

Edit my3306.cnf

Vim / etc/ my3306.cnf [client] port = 3306socket = / tmp/mysql3306.sockdefault_character_set = UTF8 [mysqld] lower_case_table_names = 1port = 3306basedir = / usr/local/mysqldatadir = / home/ Mysql3306/mysql3306socket = / tmp/mysql3306.sockpid_file = / home/mysql3306/mysql.pidtmpdir = / tmp/skip_name_resolve = 1character_set_server = utf8collation_server = utf8_unicode_cimax_connections = 512max_connect_errors = 100000interactive_timeout = 600wait_timeout = 600table_open_cache = 2048query_cache_type = 0#query_cache_size = 64M#query_cache_limit = 2Mthread_cache_size = 51max_allowed_packet = 16Mtmp_table_size = 256Mmax_tmp_tables = 128max_heap_table_size = 96Msort_buffer_size = 4Mread_buffer_size = 4m # Sequential IOjoin_buffer_size = 4Mread_rnd_buffer_size = 8m # Random IObulk_insert_buffer_size = 64m # default_storage_engine = InnoDBlog_bin = / home/mysql3306/logs/mysql-binexpire_logs_days = 7binlog_format = rowlog_slave_updates = 1log_error = / home/mysql3306/logs/mysql-error.logslow_query_log = 1 query log _ File = / home/mysql3306/logs/mysql-slow.loglong_query_time = 1log_output = FILElog_queries_not_using_indexes = 1 max_binlog_cache_size = 8Mmax_binlog_size = 1024Mbinlog_cache_size = 4Msync_binlog = 1server_id = 15133306 # innodbinnodb_data_home_dir = / home/mysql3306/mysql3306/innodb_data_file_path = ibdata1:512M:autoextendinnodb_log_group_home_dir = / home/mysql3306/mysql3306innodb_buffer_pool_instances = 1innodb_buffer_pool_size = 500Minnodb_buffer_pool_dump_pct = 40innodb_page_cleaners = 4innodb_log_file_size = 256Minnodb_log_files_in_group = 2innodb_log_buffer_size = 32m # default 16Minnodb_flush_log_at_trx_commit = 1innodb_lock_wait_timeout = 30innodb_undo_directory = / home/mysql3306/mysql3306/innodb_undo_logs = 128 # must > = 35.default 128innodb_undo_tablespaces = 3 # must > = 2innodb_undo_log_truncate = 1innodb_max_undo_log_size = 1000Minnodb_purge_rseg_truncate_frequency = 128innodb_print_all_deadlocks = 1innodb_buffer _ pool_load_at_startup = 1innodb_buffer _ pool_dump_at_shutdown = 1innodb_open_files = 65536innodb_file_per_table = 1innodb_lock_wait_timeout = 30innodb_read_io_threads = 8innodb_write_io_threads = 8innodb_io_capacity = 200innodb_flush_log_at_trx_commit = 1innodb_flush_method = O_DIRECTinnodb_purge_threads = 4innodb_support_xa = 1innodb_max_dirty_pages_pct = 75transaction_isolation = REPEATABLE-READ#repslave-parallel-type=LOGICAL_CLOCKslave-parallel-workers=16master_info_repository=TABLErelay_log_info_repository=TABLErelay_log_recovery= on [mysqldump] max_allowed_packet = 16m [MySQL] default_character_set = utf8

Create a mysql user

Useradd mysql

Create a mysql-related data directory

Mkdir-p / home/mysql3306/msyql3306mkdit-p / home/mysql3306/logs

Authorize mysql-related directories

Chown-R mysql:mysql / home/mysql3306chown-R mysql:mysql / usr/local/mysql

Initialize mysql

/ usr/local/mysql/bin/mysqld-defaults-file=/etc/my3306.cnf-initialize-insecure-explicit_defaults_for_timestamp-basedir=/usr/local/mysql-datadir=/home/mysql3306/mysql3306/-user=mysql

Start mysql

/ usr/local/mysql/bin/mysqld_safe-defaults-file=/etc/my3306.cnf-datadir=/home/mysql3306/mysql3306/-user=mysql &

Configure environment variables

Vim / etc/profileexport PATH=$PATH:/usr/local/mysql/bin

Enter mysql

Mysql-S / tmp/mysql3306.sock

Modify mysql user password

Mysql > UPDATE user SET authentication_string=password ('root123') WHERE User='root' AND Host='localhost'

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: 217

*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