|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Greetings all!
I am very much a green newbie in the world of MySQL and thus I have what I expect is a simple question but have looked to find an answer without success. The question is, Once a person "uses" a database, how does he close that database without exiting MySQL or issuing another "use" command? Is there something like a "close" or "unuse" command? I have not been able to find an answer to this anywhere. Thanks in advance for the ! --John -- The person is smart. People are dumb, panicky, dangerous animals... -- Posted via a free Usenet account from http://www.teranews.com |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
John Bevan wrote:
> Greetings all! > > I am very much a green newbie in the world of MySQL and thus I have what > I expect is a simple question but have looked to find an answer without > success. The question is, Once a person "uses" a database, how does he > close that database without exiting MySQL or issuing another "use" > command? Is there something like a "close" or "unuse" command? I have > not been able to find an answer to this anywhere. > > Thanks in advance for the ! > > --John > No, but unless you're using transactions, just using a database doesn't hold anyone else up. It's not really the same as opening a file - more like setting a directory to use for file operations. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
"John Bevan" <trali@runbox.com> wrote in message news:472ad987$0$12575$88260bb3@free.teranews.com.. . > Greetings all! > > I am very much a green newbie in the world of MySQL and thus I have what I > expect is a simple question but have looked to find an answer without > success. The question is, Once a person "uses" a database, how does he > close that database without exiting MySQL or issuing another "use" > command? Is there something like a "close" or "unuse" command? I have > not been able to find an answer to this anywhere. > > Thanks in advance for the ! > > --John > Hi John. No such thing really you don't need to close. Interesting question/thought though. HTH ------------------------------------- DSB http://www.documentscanningbureau.com |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
Mike,
Thanks for the answer. I perceived the "use" command as if it were actually opening the file at the time and, thus, quitting MySQL or shutting down the computer without issuing a close command could corrupt the file. However, from what it seems (and please correct me if my understanding is in error), the "use" command is more like "Assign" in Pascal: it assigns a filename with which file commands will be used but does nothing with the file itself. Is this correct? --John -- Posted via a free Usenet account from http://www.teranews.com |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
>Thanks for the answer. I perceived the "use" command as if it were
>actually opening the file at the time and, thus, quitting MySQL or You can view it that way. At this point it wil check the existence of the database and your permissions to access it. >shutting down the computer without issuing a close command could corrupt >the file. Quitting MySQL (the 'quit' command to the command interpreter, or mysql_close() from the C or PHP API) is a correct way to close the database. Another way is to switch to another database. An unclean disconnect (e.g. your program dumping core) will cause MySQL to roll back uncommitted transactions. The main opportunity for corrupted files is to get halfway through making a set of changes, not using transactions, then crash. Opening a file for read, then crashing your program or the system is unlikely to corrupt the file. Even opening the file for write (without truncating it), then crashing is not likely to corrupt the file. Half-completed changes are the main opportunity for corrupted files. >However, from what it seems (and please correct me if my >understanding is in error), the "use" command is more like "Assign" in >Pascal: it assigns a filename with which file commands will be used but >does nothing with the file itself. Is this correct? |
|
![]() |
| Outils de la discussion | |
|
|