Mysql an Grafana: Unterschied zwischen den Versionen

Aus xinux.net
Zur Navigation springen Zur Suche springen
Zeile 6: Zeile 6:
 
==Tabellen anlegen==
 
==Tabellen anlegen==
 
*use covid19;
 
*use covid19;
*create table statistik (datum date, best_faelle int, genesens int, verstorbene int);
+
*create table statistics (datum date, best_faelle int, genesene int, verstorbene int);
 +
 
 
=User anlegen und Rechte geben=
 
=User anlegen und Rechte geben=
 
*create user 'covid-admin'@'localhost' identified by 'oimel';
 
*create user 'covid-admin'@'localhost' identified by 'oimel';

Version vom 19. Juni 2020, 09:17 Uhr

Datenbank anlegen

  • mysql -u root -p

In Mysql

Datenbankl anlegen

    • create database covid19;

Tabellen anlegen

  • use covid19;
  • create table statistics (datum date, best_faelle int, genesene int, verstorbene int);

User anlegen und Rechte geben

  • create user 'covid-admin'@'localhost' identified by 'oimel';
  • grant all privileges on covid19.* to 'covid-admin'@'localhost';
  • flush privileges;

Tabelle anzeigen

  • desc statistik;
+-------------+---------+------+-----+---------+-------+
| Field       | Type    | Null | Key | Default | Extra |
+-------------+---------+------+-----+---------+-------+
| datum       | date    | YES  |     | NULL    |       |
| best_faelle | int(11) | YES  |     | NULL    |       |
| genesens    | int(11) | YES  |     | NULL    |       |
| verstorbene | int(11) | YES  |     | NULL    |       |
+-------------+---------+------+-----+---------+-------+
4 rows in set (0.00 sec)

CSV Datei importieren