Need help for connect database at different
Moderator: General Moderators
-
windforceus
- Forum Newbie
- Posts: 23
- Joined: Tue Mar 15, 2005 12:40 pm
Need help for connect database at different
Hi ALL
I have a php website connected to mysql database in win2000 and I plan to backup my database at 12pm every night. Users will be directed to the other database. My problem is what happen if someone log in to my website at that time? I don't know if there is such thing to disconnect user in php or reconnect a different database at certain time. If any knows...i appreciate.
ray
I have a php website connected to mysql database in win2000 and I plan to backup my database at 12pm every night. Users will be directed to the other database. My problem is what happen if someone log in to my website at that time? I don't know if there is such thing to disconnect user in php or reconnect a different database at certain time. If any knows...i appreciate.
ray
-
windforceus
- Forum Newbie
- Posts: 23
- Joined: Tue Mar 15, 2005 12:40 pm
any help is appreciated
I notice someone mention "crons" and "crons" seems can start a php script at certain time. Then, how about the users who are logging in already or have brower open?
-
windforceus
- Forum Newbie
- Posts: 23
- Joined: Tue Mar 15, 2005 12:40 pm
hmm...thanks for reply
yes, i know i can include()..but that mean the website have to keep checking the time, right? So putting a time function in db.php and checking which db i will use will make the website be able to keep checking the time difference?
-
windforceus
- Forum Newbie
- Posts: 23
- Joined: Tue Mar 15, 2005 12:40 pm
my concerns is...
The include function work when the page is loaded, so what happen if people load the page at 12:01 and i start to back up the database at 12:00? I need to have precise way to do this...
why do you want to use another database server anyway? while the mysqldump is executing, concurrent changes to your data won't be included (they will be in the backup of tomorrow). even if you directd to a *different* server, the one you are using as a source for the backup doesn't know about those changes... in this case you're ready for real pita situations..
------------------------------------------------------------------------------------
on a big site, i always see the following structure:
(these are the replications that are used for read/select)
[repl1] [repl-2] ..... [repl-n]
(this is the one used for write/insert/update)
[master]
------------------------------------------------------------------------------------
on a big site, i always see the following structure:
(these are the replications that are used for read/select)
[repl1] [repl-2] ..... [repl-n]
(this is the one used for write/insert/update)
[master]
-
windforceus
- Forum Newbie
- Posts: 23
- Joined: Tue Mar 15, 2005 12:40 pm
thanks for reply
Sorry, i am a newbie...that is why i may ask dump question. What is mydqldump doing in the database? i saw it in mysql but i dont' know what it is for..So concurrent change wont' be include? Say if those concurrent change is in the backup of tomorrow, i need to add the backup to my current database tomorrow? I have no exp on those process, that is why i ask those questions, hope you don't mind...
mysql_dump just dumps all the data and other parameters you can set into a file and you can use that file to back up your db or what ever you want to do with it.
All that will happen is that any changes that occur while you are 'dumping' the database will be inserted into your back up the following day. Nothing to worry about as that is standard when doing back up's.
It is like changing your php script and then coping it some where else then going back to the original to make any changes, those changes won't be in your back up script until you copy over it agian.
phpscott
All that will happen is that any changes that occur while you are 'dumping' the database will be inserted into your back up the following day. Nothing to worry about as that is standard when doing back up's.
It is like changing your php script and then coping it some where else then going back to the original to make any changes, those changes won't be in your back up script until you copy over it agian.
phpscott