MySQL added error from server configuration

Source: Internet
Author: User
Tags safe mode

Added a new configuration from server
Server-id = 117
Log-bin = Mysql-bin
Binlog-format = Mixed
Relay-log = Mysql-relay
Grant Replication client,replication Slave on .to [e-mail protected] ' 192.168.0.% ' identified by ' centos7 ';
Change Master to
Master_host = ' 192.168.0.106 ',
Master_user = ' Centos7 ',
Master_password = ' Centos7 ',
Master_log_file = ' mysql-bin.000002 ',
Master_log_pos = 106;

Execution start slave appears for the server is not configured as slave, and the fix in config file or with a change MASTER to error
executes show variable s like ' server_id '; view

Server-id for 0,servier-id 117 How could it be 0?
Execute command "SET GLOBAL server_id=117;" This resolves the
but set GLOBAL server_id=; The command is lost after the MySQL service restarts, so be sure to write it to the config file.
careful troubleshooting, found that the configuration contains [mysqld] and [Mysqld_safe], the new configuration file location is not the same also have a relationship? So I tried to change the configuration file to try again
put safe's configuration file on mysqld

Restart the server
to execute the start slave again;
Error The server is not configured as slave; Fix in config file or with change MASTER to
This is because the last configuration is still in use, reset
perform reset slave

If there is an error, you can reconfigure the files that are generated by the configuration.
Be sure to note
Master_log_file = ' mysql-bin.000002 ',
Master_log_pos =106;
These two options use show master status; View

The primary server is running and there is some data to join the slave server:
This procedure first backs up the data from the primary server and then copies it to the database that is imported from the server to the slave server. You can then back up the data from the server at the specified location from the primary server.

Configuration under Ubuntu
Do not configure under MY.CNF or add the following command to the bottom
It is best to configure under/ETC/MYSQL/MYSQL.CONF.D/MYSQLD.CNF
Ubuntu Slave Server
To be configured under/ETC/MYSQL/MYSQL.CONF.D/MYSQLD.CNF does not take effect
Pay attention to Safe mode
[Mysqld_safe]
Do not configure here
In the following mysqld configuration
Put it on the last side.
Server-id = 114
Log-bin = Mysql-bin
Binlog-format = Mixed
Relay-log = Mysql-relay
Add permissions on the primary server
Grant replication client,replication slave on . to [e-mail protected] ' 192.168.0.% ' identified by ' ubuntu1 ';
Add the following command from the server
Change Master to
Master_host = ' 192.168.0.106 ',
Master_user = ' ubuntu1 ',
Master_password = ' ubuntu1 ',
Master_log_file = ' mysql-bin.000003 ',
Master_log_pos = 2536;

Be sure to start from the server using the following command
Start slave;

MySQL added error from server configuration

Related Article

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.