Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

InnoDB tables, Transactions

Status
Not open for further replies.

34534534534555

IS-IT--Management
Jan 8, 2003
240
GB
Hello mysql'rs

I have made new tables that are of TYPE = InnoDB; with the intention of my DB becoming transactional. However when i run the following i get no error and no 'action'.. Am i doing something wrong?

Code:
mysql> select * from tran;
+-------+----------+
| name  | password |
+-------+----------+
| jake  | jake     |
| james |          |
+-------+----------+
2 rows in set (0.00 sec)

mysql> insert into tran values ("mike", "mike");
Query OK, 1 row affected (0.42 sec)

mysql> select * from tran;
+-------+----------+
| name  | password |
+-------+----------+
| rich  | rich     |
| ani |          |
| mike  | mike     |
+-------+----------+
3 rows in set (0.00 sec)

mysql> ROLLBACK;
Query OK, 0 rows affected (0.00 sec)

mysql>

Additionally, can anyone point me in the direction of a simple yet comprehensive guide to InnoDB and transactions on MySQL. Only if you know a resource, i can search too, i have already looked at the InnoDB part of the mysql website. But i was looking for a guide on actually using them in practice, and how i will have to alter my SQL code. Is there a way to make backups of the DB (i know about Hot backup) but a free way?

TIA


| Feedback is always appreciated as this will help to further our knowledge as well |
 
The autocomit default is set to commit after each insert. You need to set this to off. It then will do what you want.
 
From InnoDB site

To back-up for free

-Shut down your MySQL database and make sure it shuts down without errors.
-Copy all your data files into a safe place.
-Copy all your InnoDB log files to a safe place.
-Copy your my.cnf configuration file(s) to a safe place.
-Copy all the .frm files for your InnoDB tables into a safe place.

Generally the best free guide is at



Bye

Qatqat

Life is what happens when you are making other plans.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top