Sponsored Content
Top Forums Web Development [Solved] Disable mySQL autocommit Post 302532025 by Scott on Sunday 19th of June 2011 10:42:01 AM
Old 06-19-2011
[Solved] Disable mySQL autocommit

Hi.

Does anyone know how I can disable auto-commit in mySQL?

I've been Googling it for ages, and one suggestion that always comes up is adding this to /etc/my.cnf:

Code:
[mysqld]
...
init_connect='SET autocommit=0'

But that didn't work. I then read that this wouldn't work anyway for a priviliged user, so I created another user with very basic rights (select, insert, update, delete), and still it doesn't work.

So, thinking it might be because I was connecting from localhost, I installed a new VM and mySQL, and, after messing around for ages with iptables, managed to connect remotely to the mySQL server. But still it auto-commits.

I'm probably doing / missing something stupid, and it's driving me up the wall, so any help would be greatly appreciated.

TIA.

Code:
[scott@localhost ~]$ mysql --version
mysql  Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (x86_64) using readline 5.1

[scott@localhost ~]$ uname -a
Linux localhost.localdomain 2.6.18-238.12.1.el5 #1 SMP Tue May 31 13:22:04 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

[scott@localhost ~]$ cat /etc/redhat-release 
CentOS release 5.6 (Final)

 

7 More Discussions You Might Find Interesting

1. AIX

how to set AUTOCOMMIT option in AIX

Hi, Can anybody tell,how to set the auto commit option in AIX,i have tried with environmental variables option like 'export db2option=-c +a'. But its not working in my environment. is there any other option? (1 Reply)
Discussion started by: DB2AIX
1 Replies

2. Shell Programming and Scripting

How to disable Enable/Disable Tab Key

Hi All, I have bash script, so what is sintax script in bash for Enable and Disable Tab Key. Thanks for your help.:( Thanks, Rico (1 Reply)
Discussion started by: carnegiex
1 Replies

3. UNIX for Dummies Questions & Answers

[SOLVED] mysql.sock is missing..

mysql.sock file is missing in /opt/lampp/etc/ is there any backup file available in unix... since without that file .. project is not opening.. reply me as soon as possible ... (19 Replies)
Discussion started by: senkerth
19 Replies

4. UNIX and Linux Applications

command to check value of autocommit and isolation level

Hi, Pls let me know command to get following: 1. how to check current value of autocommit 2. how to check current value of isolation level I am using mysql-5.0.26 on unix -Thanks (2 Replies)
Discussion started by: newbielgn
2 Replies

5. Red Hat

SSL/TLS renegotiation DoS -how to disable? Is it advisable to disable?

Hi all Expertise, I have following issue to solve, SSL / TLS Renegotiation DoS (low) 222.225.12.13 Ease of Exploitation Moderate Port 443/tcp Family Miscellaneous Following is the problem description:------------------ Description The remote service encrypts traffic using TLS / SSL and... (2 Replies)
Discussion started by: manalisharmabe
2 Replies

6. Emergency UNIX and Linux Support

[Solved] EMERGENCY - can I revert 1 hour of mysql changes

I know, its stupid.. MYSQL on CENTOS 5 using WHM Imported a lot of users/posts from old forum to new forum, but my backup was lost. Can I somehow simply remove all mysql table changes for the last 3 hours, returning to pre-import status. ---------- Post updated at 03:44 AM ----------... (6 Replies)
Discussion started by: lawstudent
6 Replies

7. Emergency UNIX and Linux Support

[Solved] Mysql - Take data from row and copy it to another row

Sorry if I repost my question in this section, but I'm really in a hurry since I have to finish my work... :( Dear community, I have a table with two rows like: Row1 Row2 ======= ======= 7,3 text 1 1,3 text 2 1,2,3 blabla What i need to do is add/copy... (2 Replies)
Discussion started by: Lord Spectre
2 Replies
WebService::Solr(3pm)					User Contributed Perl Documentation				     WebService::Solr(3pm)

NAME
WebService::Solr - Module to interface with the Solr (Lucene) webservice SYNOPSIS
my $solr = WebService::Solr->new; $solr->add( @docs ); my $response = $solr->search( $query ); for my $doc ( $response->docs ) { print $doc->value_for( $id ); } DESCRIPTION
WebService::Solr is a client library for Apache Lucene's Solr; an enterprise-grade indexing and searching platform. ACCESSORS
o url - the webservice base url o agent - a user agent object o autocommit - a boolean value for automatic commit() after add/update/delete (default: enabled) o default_params - a hashref of parameters to send on every request o last_response - stores a WebService::Solr::Response for the last request HTTP KEEP-ALIVE Enabling HTTP Keep-Alive is as simple as passing your custom user-agent to the constructor. my $solr = WebService::Solr->new( $url, { agent => LWP::UserAgent->new( keep_alive => 1 ) } ); Visit LWP::UserAgent's documentation for more information and available options. METHODS
new( $url, \%options ) Creates a new WebService::Solr instance. If $url is omitted, then "http://localhost:8983/solr" is used as a default. Available options are listed in the ACCESSORS section. BUILDARGS( @args ) A Moose override to allow our custom constructor. add( $doc|@docs, \%options ) Adds a number of documents to the index. Returns true on success, false otherwise. A document can be a WebService::Solr::Document object or a structure that can be passed to "WebService::Solr::Document->new". Available options as of Solr 1.4 are: o overwrite (default: true) - Replace previously added documents with the same uniqueKey o commitWithin (in milliseconds) - The document will be added within the specified time update( $doc|@docs, \%options ) Alias for "add()". delete( \%options ) Deletes documents matching the options provided. The delete operation currently accepts "query" and "id" parameters. Multiple values can be specified as array references. # delete documents matching "title:bar" or uniqueId 13 or 42 $solr->delete( { query => 'title:bar', id => [ 13, 42 ], } ); delete_by_id( $id ) Deletes all documents matching the id specified. Returns true on success, false otherwise. delete_by_query( $query ) Deletes documents matching $query. Returns true on success, false otherwise. search( $query, \%options ) Searches the index given a $query. Returns a WebService::Solr::Response object. All key-value pairs supplied in "\%options" are serialzied in the request URL. auto_suggest( \%options ) Get suggestions from a list of terms for a given field. The Solr wiki has more details about the available options (http://wiki.apache.org/solr/TermsComponent) commit( \%options ) Sends a commit command. Returns true on success, false otherwise. You must do a commit after an add, update or delete. By default, autocommit is enabled. You may disable autocommit to allow you to issue commit commands manually: my $solr = WebService::Solr->new( undef, { autocommit => 0 } ); $solr->add( $doc ); # will not automatically call commit() $solr->commit; Options as of Solr 1.4 include: o maxSegments (default: 1) - Optimizes down to at most this number of segments o waitFlush (default: true) - Block until index changes are flushed to disk o waitSearcher (default: true) - Block until a new searcher is opened o expungeDeletes (default: false) - Merge segments with deletes away rollback( ) This method will rollback any additions/deletions since the last commit. optimize( \%options ) Sends an optimize command. Returns true on success, false otherwise. Options as of Solr 1.4 are the same as "commit()". ping( ) Sends a basic ping request. Returns true on success, false otherwise. generic_solr_request( $path, \%query ) Performs a simple "GET" request appending $path to the base URL and using key-value pairs from "\%query" to generate the query string. This should allow you to access parts of the Solr API that don't yet have their own correspodingly named function (e.g. "dataimport" ). SEE ALSO
o http://lucene.apache.org/solr/ o Solr - an alternate library AUTHORS
Brian Cassidy <bricas@cpan.org> Kirk Beers COPYRIGHT AND LICENSE
Copyright 2008-2012 National Adult Literacy Database This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-05-25 WebService::Solr(3pm)
All times are GMT -4. The time now is 09:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy