MariaDB (Debian): Unterschied zwischen den Versionen
Aus MattWiki
Matt (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
Matt (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
Zeile 1: | Zeile 1: | ||
== | == Connect to Server == | ||
$ mysql -u user1 -p # | $ mysql -u user1 -p # Mit Passwortabfrage | ||
$ mysql -u user1 -ppassword1 | $ mysql -u user1 -ppassword1 | ||
== User Management == | == User Management == | ||
List users: | List users: | ||
show grants; | |||
show grants [user1]; | |||
select user,host from mysql.user; | select user,host from mysql.user; | ||
Zeile 17: | Zeile 15: | ||
Grant all access to user for * tables: | Grant all access to user for * tables: | ||
grand all on database.* to 'user'@'localhost'; | grand all on database.* to 'user'@'localhost'; | ||
== Database Management == | |||
show databases; # Datenbanken anzeigen | |||
create database [database]; # Create new database | |||
use [database]; # Select Database | |||
show tables; | |||
describe [table]; | |||
== Create Database == | == Create Database == |
Version vom 8. Mai 2016, 14:34 Uhr
Connect to Server
$ mysql -u user1 -p # Mit Passwortabfrage $ mysql -u user1 -ppassword1
User Management
List users:
show grants; show grants [user1]; select user,host from mysql.user;
Create user:
create user 'username'@'localhost' identified by 'password';
Grant all access to user for * tables:
grand all on database.* to 'user'@'localhost';
Database Management
show databases; # Datenbanken anzeigen create database [database]; # Create new database use [database]; # Select Database show tables; describe [table];
Create Database
# mysql -u root -p<password> mysql> create database sugarcrm; Query OK, 1 row affected (0.02 sec)
Restore Database
mysql -u root -p[root_password] [database_name] < dumpfilename.sql