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)05/31 Report--
This article mainly introduces the window 7 next cp two mysql how to configure master and slave, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor with you to understand.
Environment:
A personal pc windows7.
Use:
Official: mysql-noinstall-5.5.11-win32.zip
1. Unzip it into 2 (folders)
Mysql_master (Master)
Mysql_slave (from)
two。 Profile modification
Master server configuration modification
Mysql_master/my-huge.ini changed its name to my.ini
Modify the my.ini file just now
[client]
Port = 3306
[mysqld]
Server-id = 1
Port = 3306
Binlog-do-db = test # synchronization test. If you turn it off here, all other libraries will be synchronized except what is not allowed.
Binlog-ignore-db=backup is not synchronized with the backup library, the following is the same as above
Binlog-ignore-db=mysql
Binlog-ignore-db=information_schema
Log-bin=mysql-bin
Start mysql-5.1.36-win32_1/bin/mysqld.exe
Create a synchronous role using the master mysql-u root
Mysql > GRANT REPLICATION SLAVE,RELOAD,SUPER ON *. * TO backupuser@'127.0.0.1' IDENTIFIED BY '123456'
Mysql > show master status
+-+
| | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | |
+-+
| | mysql-bin.000001 | 106 | test | backup | |
+-+
1 row in set (0.00 sec)
The file,position here will be used from the library.
From the server configuration:
Mysql-5.1.36-win32_2/my-huge.ini changed its name to my.ini
Modify the my.ini file just now
[client]
# password = your_password
Port = 3307
Socket = / tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server www.2cto.com
[mysqld]
Server-id = 2
Master-host = 127.0.0.1
Master-user = backup
Master-password = 123456
Master-port = 3306
Port = 3307
Start mysql-5.1.36-win32_2/bin/mysqld.exe
The situation I encountered at that time was that I did not start successfully. Check the error log.
Find [ERROR] d:/mysql_slave/bin/mysqld: unknown variable 'master-host=127.0.0.1'
Then comment out the following four lines
Master-host = 127.0.0.1
Master-user = backup
Master-password = 1234
Master-port = 3307
Then execute the following command.
Slave stop
Change master to master_host='127.0.0.1', master_user='backup', master_password='123456', master_log_file='mysql-bin.000001', master_log_pos=106; www.2cto.com
Slave start
You can use show slave status; to see what the slave library is like. But there's too much information. To facilitate viewing, you can use the following command
Show slave status\ G
Check the above Slave_IO_Running: Yes and Slave_SQL_Running: Yes are both yes to prove that the master-slave synchronization is normal. If either of them displays NO, it proves that there is a problem with the synchronization. You can check the log file, which will basically show errors, according to the error step by step troubleshooting, basically can be solved.
test
On the primary server
Use test
Create table tt (ii int);
And then from the mysql server
Use test
Show tables
Mysql > show tables
+-+
| | Tables_in_test |
+-+
| | tt |
+-+
1 row in set (0.00 sec)
Thank you for reading this article carefully. I hope the article "how to configure the two mysql of the next cp in window 7" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
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.