The following articles mainly describe how to accurately create a MySQL Image Database in linux. In this article, the MySQL version is 4.1, if you are very enthusiastic about setting up a MySQL Image Database in linux. The following article will be meaningful to you. Abstract: This article describes how to create a MySQL Image Database in linux.
The following articles mainly describe how to accurately create a MySQL Image Database in linux. In this article, the MySQL version is 4.1, if you are very enthusiastic about setting up a MySQL Image Database in linux. The following article will be meaningful to you. Abstract: This article describes how to create a MySQL Image Database in linux.
The following articles mainly describe how to accurately create a MySQL Image Database in linux. In this article, the MySQL version is 4.1, if you are very enthusiastic about setting up a MySQL Image Database in linux. The following article will be meaningful to you.
Abstract: This article describes how to create a MySQL Image Database in linux.
The MySQL version is 4.1.
Oracle helps you gain an accurate insight into each logistics Link
MySQL version: 4.1
Environment Introduction: master database 192.168.0.205 slave database 192.168.0.206
1. Create/etc/my. cnf in the master database and modify the key value in [MySQLd] to increase
- server-id=1
- log-bin=binlog_name
2. Add users to the master database to read logs from the master database.
- grant replication slave,reload,super on *.* to ’slave’@’192.168.0.206’ identified by ’123456’
3. Connect the slave database to the master database for testing.
- /opt/MySQL/bin/MySQL -u slave -p -h 192.168.0.205
4. Stop the slave database, modify the slave database/etc/my. cnf, and add the following options:
- [MySQLd] server-id=2 master-host=192.168.0.205 master-user=slave master-password=123456
5. Start slave database for master-slave Database Data Synchronization
- /opt/MySQL/share/MySQL/MySQL start
- /opt/MySQL/bin/MySQL -u root -p
- MySQL>load data from master;
Note: You can use the database to import the data or use the directory to test the data in this step.
Create a MySQL Image Database in 6 Linux: and perform the test:
Create a table in the master database,
- MySQL>create database sampdb; MySQL>create table new (name char(20),phone char(20)); MySQL>insert into new (’abc,’0532555555’);
Open the slave database and check:
- /opt/MySQL/bin/MySQL -u root -p MySQL>show database; MySQL sampdb test MySQL>use sampdb; MySQL>show tables;
New indicates that the master database is successfully created.
7. commands related to the Master/Slave database:
- slave stop; slave start ;
Start to stop the slave database.
- show slave status\G;
Displays the binary log of the master database that is being read from the slave database.
- purge master logs to ’binlog.000004’;
This command is very careful to delete binary log files that are useless to the primary database. If it is deleted by mistake, the slave database cannot be automatically updated.
- change master;
Modify the parameter usage on the server. The above content is an introduction to the creation of a MySQL Image Database in linux. I hope you will have some gains.