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 > No AUTOCOMMIT by default?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
No AUTOCOMMIT by default?

Réponse
 
LinkBack Outils de la discussion
Vieux 20/10/2007, 18h47   #1
Cloink
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut No AUTOCOMMIT by default?

Hi,

I'd like to make a MySQL user session always be in transactional-mode,
i.e. have autocommit OFF always.

I've not found a way of doing this - is it possible, or do I just
always have to type
SET AUTOCOMMIT=0;
every time I logon?

There doesn't appear to be an option in the config file to set this;
neither does there appear to be any way of running a standard script
at logon.

I'm on Windows - I thought I might be able to pass in a login-file on
the command line (using a shortcut) as though running in batch mode,
but then it just runs the script and exits straight away!

No more ideas.

appreciated,
Cheers,
Clark.

  Réponse avec citation
Vieux 20/10/2007, 23h12   #2
ZeldorBlat
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: No AUTOCOMMIT by default?

On Oct 20, 12:47 pm, Cloink <Cloink_Frigg...@yahoo.com> wrote:
> Hi,
>
> I'd like to make a MySQL user session always be in transactional-mode,
> i.e. have autocommit OFF always.
>
> I've not found a way of doing this - is it possible, or do I just
> always have to type
> SET AUTOCOMMIT=0;
> every time I logon?
>
> There doesn't appear to be an option in the config file to set this;
> neither does there appear to be any way of running a standard script
> at logon.
>
> I'm on Windows - I thought I might be able to pass in a login-file on
> the command line (using a shortcut) as though running in batch mode,
> but then it just runs the script and exits straight away!
>
> No more ideas.
>
> appreciated,
> Cheers,
> Clark.


According to the manual (which you probably have access to as well)
you can set the default behavior by adding this to your my.cnf or
my.ini:

[mysqld]
init_connect='set autocommit=0'

  Réponse avec citation
Vieux 20/10/2007, 23h44   #3
Paul Lautman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: No AUTOCOMMIT by default?

ZeldorBlat wrote:
> According to the manual (which you probably have access to as well)


Manual, surely you know that our purpose is to look all this stuff up for
the lazy posters!


  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 00h50.


É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,09244 seconds with 11 queries