Collections:
Commit the Current Transaction in MySQL
How To Commit the Current Transaction in MySQL?
✍: FYIcenter.com
If you have used some DML statements updated some data objects, and you want to have the updates to be permanently recorded in the database, you can use the COMMIT command. It will make all the database changes made in the current transaction become permanent and end the current transaction. The following tutorial exercise shows you how to use COMMIT commands:
>\mysql\bin\mysql -u dev -piyf fyi
mysql> START TRANSACTION;
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO fyi_links (url, id)
VALUES ('fyicenter.com', 101);
Query OK, 1 row affected (0.11 sec)
mysql> INSERT INTO fyi_links (url, id)
VALUES ('centerfyi.com', 110);
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM fyi_links;
+-----+---------------+-------+--------+--------------------
| id | url | notes | counts | created
+-----+---------------+-------+--------+--------------------
| 101 | fyicenter.com | NULL | NULL | 2006-07-01 20:27:49
| 110 | centerfyi.com | NULL | NULL | 2006-07-01 20:28:10
+-----+---------------+-------+--------+--------------------
2 rows in set (0.07 sec)
mysql> COMMIT;
Query OK, 0 rows affected (0.04 sec)
⇒ Rollback the Current Transaction in MySQL
⇐ Start a New Transaction Explicitly in MySQL
2016-10-17, 2288🔥, 0💬
Popular Posts:
What is SQL Server Transact-SQL (T-SQL)? SQL Server Transact-SQL, also called T-SQL, is an extension...
Where to find tutorials to answer some frequently asked questions on Microsoft SQL Server Transact-S...
How To List All Login Names on the Server in SQL Server? If you want to see a list of all login name...
How To Create a Dynamic Cursor with the DYNAMIC Option in SQL Server Transact-SQL? If the underlying...
How to download and install SQL Server 2005 Sample Scripts in SQL Server? If you want to learn from ...