MySQL: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Zeile 1: | Zeile 1: | ||
== Datenbanken eines MySQL-Servers auflisten: == | == Datenbanken eines MySQL-Servers auflisten: == | ||
< | <pre style="white-space: pre-wrap; | ||
white-space: -moz-pre-wrap; | |||
white-space: -pre-wrap; | |||
white-space: -o-pre-wrap; | |||
word-wrap: break-word;"> | |||
mysqlshow -u ''<user name>'' -p[''<password>''] | mysqlshow -u ''<user name>'' -p[''<password>''] | ||
</ | </pre> | ||
== Tabellen und Felder auflisten == | == Tabellen und Felder auflisten == | ||
Zeile 18: | Zeile 22: | ||
== Backup einer Datenbank anlegen: == | == Backup einer Datenbank anlegen: == | ||
< | <pre style="white-space: pre-wrap; | ||
white-space: -moz-pre-wrap; | |||
white-space: -pre-wrap; | |||
white-space: -o-pre-wrap; | |||
word-wrap: break-word;"> | |||
mysqldump -u ''<user name>'' -p[''<password>''] ''<database name>'' > ''<dump file name>''.sql | mysqldump -u ''<user name>'' -p[''<password>''] ''<database name>'' > ''<dump file name>''.sql | ||
</ | </pre> | ||
== Anmelden am MySQL-Server: == | == Anmelden am MySQL-Server: == | ||
< | <pre style="white-space: pre-wrap; | ||
white-space: -moz-pre-wrap; | |||
white-space: -pre-wrap; | |||
white-space: -o-pre-wrap; | |||
word-wrap: break-word;"> | |||
mysql -u ''<user name>'' -p[''<password>''] | mysql -u ''<user name>'' -p[''<password>''] | ||
</ | </pre> | ||
== Abmelden vom MySQL-Server: == | == Abmelden vom MySQL-Server: == | ||
< | <pre style="white-space: pre-wrap; | ||
white-space: -moz-pre-wrap; | |||
white-space: -pre-wrap; | |||
white-space: -o-pre-wrap; | |||
word-wrap: break-word;"> | |||
quit; | quit; | ||
</ | </pre> | ||
== Neuen Benutzer anlegen: == | == Neuen Benutzer anlegen: == | ||
Zeile 42: | Zeile 58: | ||
</pre> | </pre> | ||
Soll der Zugriff auf Localhost beschränkt sein, dann '' | Soll der Zugriff auf Localhost beschränkt sein, dann ''localhost'' anstelle von ''%'' verwenden: | ||
<pre style="white-space: pre-wrap; | <pre style="white-space: pre-wrap; | ||
white-space: -moz-pre-wrap; | white-space: -moz-pre-wrap; | ||
Zeile 51: | Zeile 67: | ||
mysql> grant usage on *.* to '<username>'@'localhost' identified by '<password>'; | mysql> grant usage on *.* to '<username>'@'localhost' identified by '<password>'; | ||
</pre> | </pre> | ||
Zurück zu [[Allgemein]] | Zurück zu [[Allgemein]] |
Version vom 10. März 2016, 00:07 Uhr
Datenbanken eines MySQL-Servers auflisten:
mysqlshow -u ''<user name>'' -p[''<password>'']
Tabellen und Felder auflisten
mysql -u ''<user name>'' -p mysql> use <database>; mysql> show tables from <database>; mysql> show fields from <table_name>; mysql> quit;
Backup einer Datenbank anlegen:
mysqldump -u ''<user name>'' -p[''<password>''] ''<database name>'' > ''<dump file name>''.sql
Anmelden am MySQL-Server:
mysql -u ''<user name>'' -p[''<password>'']
Abmelden vom MySQL-Server:
quit;
Neuen Benutzer anlegen:
mysql> create user '<username>'@'%' identified by '<password>'; mysql> grant usage on *.* to '<username>'@'%' identified by '<password>';
Soll der Zugriff auf Localhost beschränkt sein, dann localhost anstelle von % verwenden:
mysql> create user '<username>'@'localhost' identified by '<password>'; mysql> grant usage on *.* to '<username>'@'localhost' identified by '<password>';
Zurück zu Allgemein