linux:mysql
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| linux:mysql [2016/07/19 09:43] – [Weblinks] move | linux:mysql [2019/08/16 13:50] (aktuell) – [Benutzer] move | ||
|---|---|---|---|
| Zeile 29: | Zeile 29: | ||
| use MEINE_DB; | use MEINE_DB; | ||
| </ | </ | ||
| + | |||
| + | === Tabellen anzeigen === | ||
| + | Vorher DB auswählen (use MeineDB;) | ||
| + | |||
| + | < | ||
| + | show tables; | ||
| + | </ | ||
| + | |||
| + | === Tabelle(n) löschen === | ||
| + | |||
| + | < | ||
| + | DROP TABLE MeineTabelle; | ||
| + | |||
| + | DROP TABLE (Meinetabelle1, | ||
| + | </ | ||
| + | |||
| + | <WRAP center round tip> | ||
| + | Tabellen mit bestimmten Prefix löschen (quick & dirty): | ||
| + | < | ||
| + | show tables like ' | ||
| + | </ | ||
| + | copy the results and paste them into a text editor or output the query to a file, use a few search and replaces to remove unwanted formatting and replace \n with a comma put a ; on the end and add drop table to the front. | ||
| + | |||
| + | you'll get something that looks like this: | ||
| + | < | ||
| + | drop table myprefix_1, myprefix_2, myprefix_3; | ||
| + | </ | ||
| + | </ | ||
| ===Alle Tabellenspalten anzeigen=== | ===Alle Tabellenspalten anzeigen=== | ||
| Zeile 45: | Zeile 73: | ||
| </ | </ | ||
| - | === Tabblen-Rows löschen === | + | === Tabellen-Reihen |
| < | < | ||
| DELETE FROM ma_job WHERE job_id IN (620981, 620982, 620984, 620985, 620986) | DELETE FROM ma_job WHERE job_id IN (620981, 620982, 620984, 620985, 620986) | ||
| Zeile 69: | Zeile 97: | ||
| DROP DATABASE menagerie; | DROP DATABASE menagerie; | ||
| </ | </ | ||
| + | |||
| + | Falls im Namen der Datenbank ein Bindestrich ist, kommt es zu einer Fehlermeldung: | ||
| + | |||
| + | //ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' | ||
| + | |||
| + | Dann hilft es die DB in `` zu setzen, z.B.: `meineDB-db` | ||
| + | |||
| + | === Ausgabe in CVS-datei schreiben === | ||
| + | < | ||
| + | SELECT spalte1, | ||
| + | FROM tabelle | ||
| + | INTO OUTFILE '/ | ||
| + | </ | ||
| + | |||
| ==== Benutzer ==== | ==== Benutzer ==== | ||
| Zeile 124: | Zeile 166: | ||
| </ | </ | ||
| + | === Passwort des Benutzx ändern === | ||
| + | < | ||
| + | ALTER USER ' | ||
| + | </ | ||
| ===== Siehe auch ===== | ===== Siehe auch ===== | ||
| - | + | ||
| * [[mysqldump]] | * [[mysqldump]] | ||
| + | * [[myCLI]] | ||
| + | * [[adminer]] | ||
| + | * [[phpmyadmin]] | ||
| + | * [[mariadb]] | ||
| ===== Weblinks ===== | ===== Weblinks ===== | ||
| Zeile 133: | Zeile 183: | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| + | |||
| + | ==== Diverse ==== | ||
| + | |||
| + | * [[https:// | ||
linux/mysql.1468921430.txt.gz · Zuletzt geändert: (Externe Bearbeitung)
