MySQL Replication by MySQL Rumi, June 27, 2011 The easiest and most straightforward method for setting up replication is to use new master and slave servers. You can also use this method if you are setting up new servers but have an existing dump of the databases from a different server that you want to load into your replication configuration. By loading the data into a new master, the data will be automatically replicated to the slaves. To set up replication between a new master and slave: Configure the MySQL master with the necessary configuration properties. See Section 15.1.1.1, “Setting the Replication Master Configuration”. Start up the MySQL master. Set up a user. See Section 15.1.1.3, “Creating a User for Replication”. Obtain the master status information. See Section 15.1.1.4, “Obtaining the Replication Master Binary Log Coordinates”. On the master, release the read lock: mysql> UNLOCK TABLES; On the slave, edit the MySQL configuration. See Section 15.1.1.2, “Setting the Replication Slave Configuration”. Start up the MySQL slave. Execute a CHANGE MASTER TO statement to set the master replication server configuration. See Section 15.1.1.10, “Setting the Master Configuration on the Slave”. Perform the slave setup steps on each slave. Because there is no data to load or exchange on a new server configuration you do not need to copy or import any information. If you are setting up a new replication environment using the data from a different existing database server, you will now need to run the dump file generated from that server on the new master. The database updates will automatically be propagated to the slaves: shell> mysql -h master < fulldb.dump http://dev.mysql.com/doc/refman/5.0/en/replication-howto-newservers.html Related MySQL
MySQL Cheat Sheet February 1, 2012 Selecting a database: mysql> USE database; Listing databases: mysql> SHOW DATABASES; Listing tables in a db: mysql> SHOW TABLES; Describing the format of a table: mysql> DESCRIBE table; Creating a database: mysql> CREATE DATABASE db_name; Creating a table: mysql> CREATE TABLE table_name (field1_name TYPE(SIZE), field2_name TYPE(SIZE)); Ex: mysql> CREATE TABLE… Read More
Percona Mysql Service Force Stop June 10, 2020 Service mysql stop is being ignored. How to fix? Try mysqladmin -u root -p shutdown Alternatively, In case you have started /etc/init.d/mysql bootstrap-pxc So in this case you should stop bootstrapped node using /etc/init.d/mysql bootstrap-stop Related Read More
Install Mydumper Myloader on Centos 7 June 11, 2020July 4, 2020 If you want to execute logical backups using an alternative to mysqldump that works with parallel threads giving faster execution times mydumper is the correct tool. wget https://github.com/maxbube/mydumper/releases/download/v0.9.5/mydumper-0.9.5-2.el7.x86_64.rpm In order to use mydumper and myloader you can use the following sample commands: For dumping/exporting database: mydumper -u <username> -p <password>… Read More