Re: Undo function?

2005-01-21 Thread Duan Pavlica
Hi,
I want to add one more thing. Usually manually entered queries must end up 
with semicolon so if you hit enter before the end nothing happens.

Regards,
Dusan
- Original Message - 
From: shaun thornburgh [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Thursday, January 20, 2005 2:17 PM
Subject: Undo function?


Hi,
I get very nervous when I log onto my database via SSH and type in queries 
manually. Take the following query for example:

Delete FROM Users WHERE User_ID = 5;
If I hit return before I start typing WHERE then things would be 
disastorous! Is there any type of undo function with MySQL?

Thanks for your help.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Undo function?

2005-01-20 Thread Martijn Tonies
Hello,

 I get very nervous when I log onto my database via SSH and type in queries
 manually. Take the following query for example:

 Delete FROM Users WHERE User_ID = 5;

 If I hit return before I start typing WHERE then things would be
 disastorous! Is there any type of undo function with MySQL?

Use innodb tables and set autocommit to OFF.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL  MS SQL
Server
Upscene Productions
http://www.upscene.com


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Undo function?

2005-01-20 Thread Jay Blanchard
[snip]
I get very nervous when I log onto my database via SSH and type in
queries 
manually. Take the following query for example:

Delete FROM Users WHERE User_ID = 5;

If I hit return before I start typing WHERE then things would be 
disastorous! Is there any type of undo function with MySQL?
[/snip]

You'll want to read this

http://dev.mysql.com/doc/mysql/en/COMMIT.html

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Undo function?

2005-01-20 Thread harmen-mysql
On Thu, Jan 20, 2005 at 08:58:18AM -0600, Jay Blanchard wrote:
 [snip]
 I get very nervous when I log onto my database via SSH and type in
 queries 
 manually. Take the following query for example:
 
 Delete FROM Users WHERE User_ID = 5;
 
 If I hit return before I start typing WHERE then things would be 
 disastorous! Is there any type of undo function with MySQL?
 [/snip]
 
 You'll want to read this
 
 http://dev.mysql.com/doc/mysql/en/COMMIT.html

And try:
$ mysql --i-am-a-dummy

that makes it refuse deletes without 'where'

Good luck,
Harmen



-- 
The Moon is Waxing Gibbous (81% of Full)

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Undo function?

2005-01-20 Thread Artem Koltsov
Hello,

If you define table type as InnoDB, you can use transactions (see the link 
below). You will need set AUTOCOMMIT=0, and after you can issue COMMIT or 
ROLLBACK at the end of query or session to submit or cancel a transaction. I 
don't think you can use transactions for mysql system tables because they have 
to be MyISAM type, so the best solution for them will be backups.

http://dev.mysql.com/doc/mysql/en/InnoDB_transaction_model.html


 -Original Message-
 From: shaun thornburgh [mailto:[EMAIL PROTECTED]
 Sent: Thursday, January 20, 2005 8:17 AM
 To: mysql@lists.mysql.com
 Subject: Undo function?
 
 
 Hi,
 
 I get very nervous when I log onto my database via SSH and 
 type in queries 
 manually. Take the following query for example:
 
 Delete FROM Users WHERE User_ID = 5;
 
 If I hit return before I start typing WHERE then things would be 
 disastorous! Is there any type of undo function with MySQL?
 
 Thanks for your help.
 
 
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:
 http://lists.mysql.com/[EMAIL PROTECTED]
 
 
 
Attention:
Any views expressed in this message are those of the individual sender, except 
where the message states otherwise and the sender is authorized to state them 
to be the views of any such entity. The information contained in this message 
and or attachments is intended only for the person or entity to which it is 
addressed and may contain confidential and/or privileged material.  If you 
received this in error, please contact the sender and delete the material from 
any system and destroy any copies.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Undo function?

2005-01-20 Thread Andy Eastham
Backups are good too :-)

Andy

 -Original Message-
 From: Artem Koltsov [mailto:[EMAIL PROTECTED]
 Sent: 20 January 2005 15:06
 To: mysql@lists.mysql.com
 Subject: RE: Undo function?
 
 Hello,
 
 If you define table type as InnoDB, you can use transactions (see the link
 below). You will need set AUTOCOMMIT=0, and after you can issue COMMIT or
 ROLLBACK at the end of query or session to submit or cancel a transaction.
 I don't think you can use transactions for mysql system tables because
 they have to be MyISAM type, so the best solution for them will be
 backups.
 
 http://dev.mysql.com/doc/mysql/en/InnoDB_transaction_model.html
 
 
  -Original Message-
  From: shaun thornburgh [mailto:[EMAIL PROTECTED]
  Sent: Thursday, January 20, 2005 8:17 AM
  To: mysql@lists.mysql.com
  Subject: Undo function?
 
 
  Hi,
 
  I get very nervous when I log onto my database via SSH and
  type in queries
  manually. Take the following query for example:
 
  Delete FROM Users WHERE User_ID = 5;
 
  If I hit return before I start typing WHERE then things would be
  disastorous! Is there any type of undo function with MySQL?
 
  Thanks for your help.
 
 
 
  --
  MySQL General Mailing List
  For list archives: http://lists.mysql.com/mysql
  To unsubscribe:
  http://lists.mysql.com/[EMAIL PROTECTED]
 
 
 
 Attention:
 Any views expressed in this message are those of the individual sender,
 except where the message states otherwise and the sender is authorized to
 state them to be the views of any such entity. The information contained
 in this message and or attachments is intended only for the person or
 entity to which it is addressed and may contain confidential and/or
 privileged material.  If you received this in error, please contact the
 sender and delete the material from any system and destroy any copies.
 
 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Undo function?

2005-01-20 Thread John Pignata
Also a good practice for shakey hands is to start mysql with the 
--safe-updates option. This will not allow a delete or update to be 
executed without a where clause.

On Thu, 20 Jan 2005 10:55 am, Andy Eastham wrote:
Backups are good too :-)
Andy
 -Original Message-
 From: Artem Koltsov [mailto:[EMAIL PROTECTED]
 Sent: 20 January 2005 15:06
 To: mysql@lists.mysql.com
 Subject: RE: Undo function?
 Hello,
 If you define table type as InnoDB, you can use transactions (see the 
link
 below). You will need set AUTOCOMMIT=0, and after you can issue 
COMMIT or
 ROLLBACK at the end of query or session to submit or cancel a 
transaction.
 I don't think you can use transactions for mysql system tables because
 they have to be MyISAM type, so the best solution for them will be
 backups.

 http://dev.mysql.com/doc/mysql/en/InnoDB_transaction_model.html
  -Original Message-
  From: shaun thornburgh [mailto:[EMAIL PROTECTED]
  Sent: Thursday, January 20, 2005 8:17 AM
  To: mysql@lists.mysql.com
  Subject: Undo function?
 
 
  Hi,
 
  I get very nervous when I log onto my database via SSH and
  type in queries
  manually. Take the following query for example:
 
  Delete FROM Users WHERE User_ID = 5;
 
  If I hit return before I start typing WHERE then things would be
  disastorous! Is there any type of undo function with MySQL?
 
  Thanks for your help.
 
 
 
  --
  MySQL General Mailing List
  For list archives: http://lists.mysql.com/mysql
  To unsubscribe:
  http://lists.mysql.com/[EMAIL PROTECTED]
 
 
 Attention:
 Any views expressed in this message are those of the individual 
sender,
 except where the message states otherwise and the sender is 
authorized to
 state them to be the views of any such entity. The information 
contained
 in this message and or attachments is intended only for the person or
 entity to which it is addressed and may contain confidential and/or
 privileged material.  If you received this in error, please contact 
the
 sender and delete the material from any system and destroy any copies.

 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]
John Pignata [EMAIL PROTECTED]
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]