In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the method of Mysql5.6 binary installation and deployment under Linux. The content of the article is carefully selected and edited by the author. It has a certain pertinence and is of great significance to everyone's reference. The following is to understand the method of Mysql5.6 binary installation and deployment under Linux with the author.
1.1 download binary installation package
Wget https://dev.mysql.com/get/downloads/mysql-5.6/mysql-5.6.40-linux-glibc2.12-x86_64.tar.gz
1.2 create mysql users and groups
?
12groupadd-r-g 306 mysqluseradd-r-g 306-u 306-m-s / sbin/nologin mysql
1.3 decompression
?
1tar xf mysql-5.6.40-linux-glibc2.12-x86_64.tar.gz-c / usr/local
1.4 create a mysql soft connection
?
12cd / usr/localln-s mysql-5.6.40-linux-glibc2.12-x86_64 mysql
1.5 modify the permissions of the master and group to which you belong
?
12chown-r mysql.mysql / usr/local/mysql-5.6.40-linux-glibc2.12-x86_64chown mysql.mysql / usr/local/mysql
1.6 create a directory and modify the master of the mysql directory
?
123mkdir-p / data/mysql {, _ binlog} chown-r mysql.mysql / data/mysqlchown-r mysql.mysql / data/mysql_binlog
1.7 create a profile directory
?
12mkdir / etc/mysql/cp / usr/local/mysql/support-files/my-default.cnf / etc/mysql/my.cnf
1.8Profiles vim / etc/mysql/my.cnf
?
1234567891011121314151617181920212223242627 [client] port = 3306socket = / data/mysql/ mysql.sock [mysqld] port = 3306user = mysqlbasedir = / usr/local/mysqldatadir = / data/mysqlsocket = / data/mysql/mysql.pidlog-error = / data/mysql/mysql_error.logcharacter-set-server = utf8init_connect='set names utf8'innodb_log_file_size = 256minnodb_file_format = barracudainnodb_strict_mode = 0innodb_file_per_table = on# Skip hostname resolution skip-name-resolve# CVM id Cluster required configuration, distinguishing machine number, different for each machine server_id = opening binary logs, row-level records, writing synchronously to disk log_bin = / data/mysql_binlog/mysql-binbinlog_format = rowsync_binlog = 1sqlwriting modestarted restricted transrecords transsynchronously writing to disk log_bin = / rowsync_binlog = 1sqlwriting modeboxes, row-level records, writing to disk synchronously.
1.9 modify the path environment variable
?
123] # vim / etc/profile.d/mysql.sh path=/usr/local/mysql/bin:$path] # source / etc/profile.d/mysql.sh
2.0 create a database file
?
12cd / usr/local/mysql/./scripts/mysql_install_db-datadir=/data/mysql-user=mysql
2.1 prepare the startup script
?
12cd / usr/local/mysql/./scripts/mysql_install_db-datadir=/data/mysql-user=mysql
2.2 Security initialization
?
123ln-s / data/mysql/mysql.sock / tmp/mysql.sockmysql_secure_installationroot has no password-- > enter directly-- > whether to set password y to enter password-- > whether to delete anonymous users y-- > whether to disable root remote connection n-- > whether to delete test test database y-> whether to reload database y-- > ok
2.3 Master-Slave replication Architecture
2.3.1 profile
Master master database
?
123log_bin=/bin_log_path/mysql-bin enables binary logging binlog _ format = row binary logging mode, row-level logging server_id = 1
2.3.2 create a dedicated user for master-slave replication
?
1mysql > grant replication salve on *. * to 'repluer'@'172.16.1.%' identified by' 123456'
2.3.3 refresh the binary log
?
12mysql > reset master;mysql > show master status
2.3.3 slave slave database configuration file
?
1server_id=2
2.4 establish master-slave association
?
123mysql > change master to master_host='172.16.1.211',master_user='repluser',master_password='123456',master_log_file='mysql-bin.000001',master_log_pos=120
2.4.1 View and enable slave nodes
?
12mysql > start slave;mysql > show slave status\ g
Description: master-slave replication architecture is multi-slave synchronization of one master data, which may cause great pressure on the master node. Master-slave cascade replication can be used. The master node is responsible for one slave node, and the slave node is responsible for the next slave node.
Mainly used for configuration
Configure log_bin binary logging configuration from node
Log_slave_updates writes the synchronized data to the binary log to facilitate the synchronization of the next slave node.
After reading the above about the method of Mysql5.6 binary installation and deployment under Linux, many readers must have some understanding. If you need to get more industry knowledge and information, you can continue to follow our industry information column.
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.