MariaDB (Debian): Unterschied zwischen den Versionen

Aus MattWiki
Keine Bearbeitungszusammenfassung
Zeile 24: Zeile 24:


Grant all access to user for * tables:  
Grant all access to user for * tables:  
  grand all on database.* to 'user'@'localhost';
  grant all on database.* to 'user'@'localhost';


== Create Database ==
== Create Database ==

Version vom 8. Mai 2016, 15:43 Uhr

Connect to Server

$ mysql -u user1 -p                     # Mit Passwortabfrage
$ mysql -u user1 -ppassword1
exit                                    # Close connection


Database Management

show databases;                         # Datenbanken anzeigen
create database [database];             # Create new database
use [database];                         # Select Database
show tables;
describe [table]; 


User Management

show grants;                            # Show grants of current user
show grants for user1                   # Show grants for user1

List users:

select user,host from mysql.user;

Create user:

create user 'username'@'localhost' identified by 'password';

Grant all access to user for * tables:

grant all on database.* to 'user'@'localhost';

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