Dino Geek, try to help you

How to export a MariaDB table to a CSV file?


You can export a MariaDB table to a CSV file by using the `SELECT INTO OUTFILE` statement. The syntax would look something like this:

```
SELECT * INTO OUTFILE ‘/path/to/yourfile.csv’
FIELDS TERMINATED BY ‘,’
ENCLOSED BY ‘”’
LINES TERMINATED BY ‘\n‘
FROM your_table;
```

Replace `/path/to/yourfile.csv` with the path where you want to store the file on your server. The file name should end with `.csv`.

Replace `your_table` with the name of the table that you want to export.

Here is a breakdown of the statement:

- `FIELDS TERMINATED BY ‘,’`: This means that the fields are separated by a comma.
- `ENCLOSED BY ‘”’`: This means that the fields are enclosed by double quotes.
- `LINES TERMINATED BY ‘\n’`: This means that the lines are terminated by a newline character.

Please note if you are not the administrator, you may need to check with your database administrator for permission to write files directly on the server.


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