Dino Geek, try to help you

How can I rollback in MariaDB?


(1) Open the MariaDB command line interface and then SELECT the database you are using with the following command:

```
USE database_name;
```

(2) You can start a transaction with the START TRANSACTION command:

```
START TRANSACTION;
```

(3) Now you can execute the commands or queries you need.

(4) If an error occurs or you decide you want to cancel the changes made after the START TRANSACTION command, you can use the ROLLBACK command.

For example, let’s say you delete a row from a table and then decide to undo that action. This can be done as following:

```
START TRANSACTION;
DELETE FROM table_name WHERE condition;
ROLLBACK;
```
The ROLLBACK command will reverse all changes made after the START TRANSACTION command. After rolling back, the data will return to its state prior to the start of the transaction.

(5) However, if you want to save your changes, use the COMMIT command as follows:

```
START TRANSACTION;
DELETE FROM table_name WHERE condition;
COMMIT;
```

In this case, COMMIT will save all changes to the database since the last START TRANSACTION command. The changes can no longer be rolled back after running the COMMIT command.


Simply generate articles to optimize your SEO
Simply generate articles to optimize your SEO





DinoGeek offers simple articles on complex technologies

Would you like to be quoted in this article? It's very simple, contact us at dino@eiki.fr

CSS | NodeJS | DNS | DMARC | MAPI | NNTP | htaccess | PHP | HTTPS | Drupal | WEB3 | LLM | Wordpress | TLD | Domain name | IMAP | TCP | NFT | MariaDB | FTP | Zigbee | NMAP | SNMP | SEO | E-Mail | LXC | HTTP | MangoDB | SFTP | RAG | SSH | HTML | ChatGPT API | OSPF | JavaScript | Docker | OpenVZ | ChatGPT | VPS | ZIMBRA | SPF | UDP | Joomla | IPV6 | BGP | Django | Reactjs | DKIM | VMWare | RSYNC | Python | TFTP | Webdav | FAAS | Apache | IPV4 | LDAP | POP3 | SMTP

| Whispers of love (API) | Déclaration d'Amour |






Legal Notice / General Conditions of Use