Complete MySQL installation and master-slave dual-machine configuration

Source: Internet
Author: User

Complete MySQL installation and master-slave dual-machine configuration

Example HOST: 192.168.0.1 example slave: 192.168.0.2
 
################### Complete mysql installation ################## #

Groupadd mysql
Useradd-g mysql
Mv/root/mysql-5.0.51b.tar.gz/usr/local/src
Tar-zxvf mysql-5.0.51b.tar.gz
Cd mysql-5.0.51b
. /Configure-with-charset = latin1-with-extra-charsets = all-enable-starter er-with-mysqld-ldflags =-all-static-with-mysqld-user = mysql- prefix =/usr/local/mysql-5.0.51b-localstatedir =/data/mysql5051_db
Make
Make install
Ln-s/usr/local/mysql-5.0.51b/usr/local/mysql
Mkdir-p/data/mysql5051_db/dbdata
Mkdir-p/data/mysql5051_db/innodb
Mkdir-p/data/mysql5051_db/binlog
Chown-R mysql: mysql/data/mysql5051_db
Chmod-R 775/data/mysql5051_db
Cd/usr/local/src/mysql-5.0.51b
Vim./scripts/ldata =/data/mysql5051_db/dbdata in mysql_install_db
Cp./support-files/my-small.cnf/etc/my. cnf
/Usr/local/mysql-5.0.51b/bin/mysql_install_db-basedir =/usr/local/mysql-5.0.51b-ldata =/data/mysql5051_db/dbdata-user = mysql
Vim/etc/my. cnf
Bind-address = 192.168.0.8
Datadir =/data/mysql5051_db/dbdata/
Pid-file =/data/mysql5051_db/my. pid
Log-slow-queries =/data/mysql5051_db/dbdata/slowquery. SQL
Log-bin =/data/mysql5051_db/binlog/sortrepl. log
################ Innodb ####################
# Uncomment the following if you are using InnoDB tables
Innodb_data_home_dir =/data/mysql5051_db/innodb/
Innodb_data_file_path = ibdata1: 1000 M; ibdata2: 1000 M: autoextend: max: 800 M
Innodb_log_group_home_dir =/data/mysql5051_db/innodb/
Innodb_log_arch_dir =/data/mysql5051_db/innodb/
# You can set .. _ buffer_pool_size up to 50-80%
# Of RAM but beware of setting memory usage too high
Innodb_buffer_pool_size = 600 M
Innodb_additional_mem_pool_size = 20 M
# Set .. _ log_file_size to 25% of buffer pool size
Innodb_log_files_in_group = 4
Innodb_log_file_size = 400 M
Innodb_log_buffer_size = 160 M
Innodb_flush_log_at_trx_commit = 0
Innodb_thread_concurrency = 8
# Innodb_flush_method = O_DSYNC
Innodb_lock_wait_timeout = 50
################ Innodb ####################
# Start the service
#/Usr/local/mysql/bin/mysqld_safe-umysql &
#/Usr/local/mysql-5.0.51b/bin/mysql
# Close the service
#/Usr/local/mysql/bin/mysqladmin shutdown
################### Complete mysql installation ################# ##

For more details, please continue to read the highlights on the next page:

Recommended reading:

Load Nginx in Ubuntu for high-performance WEB Server 5 --- MySQL master/Master Synchronization

Production Environment MySQL master/Master synchronization primary key conflict handling

MySQL Master/Slave failure error Got fatal error 1236

MySQL master-slave replication, implemented on a single server

  • 1
  • 2
  • Next Page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.