A simple solution for creating a MySQL Image Database in linux

Source: Internet
Author: User
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

 
 
  1. server-id=1
  2. log-bin=binlog_name

2. Add users to the master database to read logs from the master database.

 
 
  1. 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.

 
 
  1. /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:

 
 
  1. [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

 
 
  1. /opt/MySQL/share/MySQL/MySQL start
  2. /opt/MySQL/bin/MySQL -u root -p
  3. 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,

 
 
  1. 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:

 
 
  1. /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:

 
 
  1. slave stop; slave start ;

Start to stop the slave database.

 
 
  1. show slave status\G;

Displays the binary log of the master database that is being read from the slave database.

 
 
  1. 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.

 
 
  1. 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.

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.