简体   繁体   中英

Is database, user creation replicated on MySql?

I am deploying new application, I 'm using mysql 5.6

I setup database replication (master/slave).

I have a question: Are tasks like database creation, User creation replicated to slave? Do I have to create the database on each slave, or the replication will create them? do i have to create the user on each server or the operation will be replicated automatically?

Thanks

Yes and No

the reason how do you config the replication. there are many things in the configuration like ignore DB, ignore table and so on.

If nothing set all schemas, tables, views and so on are created and modifyed by the Master.

So you CANT create a Schema,table or User on the SLAVE and later you create them on the Master. then the replication will stops with error.

Replication should not include permission. Applications using master and slave should use different credentials and privileges to be always secure.

For eg, if I have a click-stream application, in master I will use clicker user with writes while slave will be used by a reporting tool with read-only with user name like clicker-ro or analyticsro. When I mean secure, a member of analytics should never have access to master db( to avoid writes and to avoid heavy queries in master)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM