PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > Closing a database
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Closing a database

Réponse
 
LinkBack Outils de la discussion
Vieux 02/11/2007, 09h52   #1
John Bevan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Closing a database

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

  Réponse avec citation
Vieux 02/11/2007, 11h58   #2
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Closing a database

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
==================

  Réponse avec citation
Vieux 02/11/2007, 22h42   #3
Mike
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Closing a database


"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



  Réponse avec citation
Vieux 05/11/2007, 02h21   #4
John Bevan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Closing a database

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

  Réponse avec citation
Vieux 05/11/2007, 03h29   #5
Gordon Burditt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Closing a database

>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?

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 10h40.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,16611 seconds with 13 queries