Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| wiki:mysql [2024/04/21 12:04] – created 5.152.82.90 | wiki:mysql [2024/05/08 08:19] (current) – 5.152.82.90 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | =====MySQL Conf===== | ||
| + | <code file .my.cnf> | ||
| + | [client] | ||
| + | host=127.0.0.1 | ||
| + | database=db_name | ||
| + | user=db_user | ||
| + | password=db_passwd | ||
| + | </ | ||
| + | |||
| =====MySQL Dump===== | =====MySQL Dump===== | ||
| + | **Dump ALL databases** | ||
| + | < | ||
| + | |||
| **Dump database without create db** | **Dump database without create db** | ||
| - | < | + | < |
| **Dump database with create db** | **Dump database with create db** | ||
| Line 12: | Line 24: | ||
| **Cut single table from dump** | **Cut single table from dump** | ||
| < | < | ||
| + | |||
| + | =====Useful commands==== | ||
| + | **Purge Binlog** | ||
| + | < | ||
| + | BINLOG_FILE=$(mysql -e "SHOW MASTER STATUS" | ||
| + | mysql -e "PURGE BINARY LOGS TO ' | ||
| + | |||
| + | **DB Size** | ||
| + | < | ||
| + | |||
| + | **Secure Installation** | ||
| + | < | ||
| + | mysql -e " | ||
| + | mysql -e "DROP USER '' | ||
| + | mysql -e "DROP USER '' | ||
| + | mysql -e "DROP DATABASE test" | ||
| + | mysql -e "FLUSH PRIVILEGES" | ||
| + | </ | ||