Jump to content
xisto Community
Sign in to follow this  
sirknight

Mirror My MySQL Database To Another Mysql Server

Recommended Posts

Hi..I want to ask if its possible to automatically mirror my mysql databases into another mysql server?or create a small php script to do this?The reason is because, we all know that database is very improtant if we have dynamic website.I have my forum hosted and i want to automatically mirror this or backup into another mysql server(free). Like in freesql.org. So that im not afraid that i forgot to backup my database..also i have one central backup database.Thanks for the help..Im looking forward for this posibility.

Share this post


Link to post
Share on other sites

Hi sirknight,

MySQL in itself provides an excellent way of mirroring your databases - but for that you have to set up another server somewhere known as a Replication Server - usually the Master Server and the Replication Server exist on the same network, to enable faster updates.

 

Problem with this is, you Master Server has to be configured to recognize the Slave Replicator (you can specify this in the my.cnf file) and the Slave will also have to be trained to get updates from the master. The process is very simple and can be done in a short few steps.

 

If the setup is done in this format, the Master Server keeps generating some files called Binary Logs, that contain information about incremental changes to your databases. The Slave's run TWO threads - one which keeps fetching these Binary logs down to the Slave, and another thread, which acts upon the logs, figures out what changes have been made and immediately updates its own databases with the changes pulled out from the master.

 

You can periodically keep deleting the binary logs, as they keep on being generated and eat up ur disk space. The thread that fetches the logs, maintains a persistent connection - which means, as soon as the master generates a log, it's pulled out by the slave. The updates can happen anytime later on coz the slave has already got hold of the update information. Even if the link fails in between, the slave can later on work on the logs stored on it's own drive and do the updates properly. The process is extremely efficient and I've got one running on my own LAN for testing purposes. It's works out AWESOME :D

 

But with free hosting services and even with most paid ones, I don't think they'll be ready to change their my.cnf to point to your replication server - still it's worth a try...

 

Hope this will guide you to the right direction. If you need more information, post again... :(

 

Regards,

m^e

Share this post


Link to post
Share on other sites

You get my point. Thanks,.But i want to replicate or mirror my database here in asta host to another site.Actually this is much related to my other post, and as you have said Xisto did not allow to access my mysql database from other site. :( which i want to do so im no longer worry i dont have backups.

Share this post


Link to post
Share on other sites

See as far as I <-- know, asta databases limit the access to only the asta web-server. But then again, I might be wrong :( You should ask OpaQue instead - he'll be able to clarify better. What I said was from my own observation, but I might be mistaken and there could be a way to directly access your db from another IP.Regards,m^e

Share this post


Link to post
Share on other sites

user is not permitted access to mysql configuration, so user cannot make a replication database.

 

if you are a databases administrator, u can create replication database.

 

i think, u make a coding that if u manipulation database, u should insert/update/delete to other database.

 

example : u have database_1 on host1.mysql.uk and database_2 on host2.mysql.org

 

u make coding where u your program connect to host1.mysql.uk & host2.mysql.org.

 

if u manipulate your data, each database must be manipulated too.

 

u should save to innodb (not myISAM) , why ??

because you must use procedure / transaction (commit, rollback)

Share this post


Link to post
Share on other sites
mirrored database for mysqlMirror My MySQL Database To Another Mysql Server

Hi there,

We have here currently problems with our replication server. The scenario is. The slave was not updating the master db. We tried to repair tables and still the sincronisation wont yet work.

Please help

Thanks

ED

Share this post


Link to post
Share on other sites
000webhost mysql connectionMirror My MySQL Database To Another Mysql Server

Hello everybody,  I need some help I don't know what is happening my 000webhost mysql  it has never worked since I started it, the file manager works fine, the database is already created but I can not connect with the database I already try everything but keep on telling me this: Thank you in advance

Warning:mysql_connect() Access denied for user using password YES

Warning: mysql_select_db() Access denied for user nobody@localhost using password NO

Warning: mysql_select_db() A link to the server could not be established

Warning mymsql_query() Access denied for user nobody@localhost using password NO

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.