23 lines
1.1 KiB
Markdown
23 lines
1.1 KiB
Markdown
---
|
|
title: MariaDB
|
|
description: MariaDB server information
|
|
icon: simple/mariadb
|
|
---
|
|
|
|
## Databases
|
|
|
|
| Database | Address | Port | User |
|
|
| ----------- | ----------- | ---- | ----------- |
|
|
| pterodactyl | 10.10.10.52 | 3306 | pterodactyl |
|
|
***All passwords stored in KeePassXC database.***
|
|
|
|
## Cheatsheet
|
|
|
|
| Usage | Command
|
|
| :-------------------------------------------------------------|:-------------
|
|
| Open mariadb | `sudo mariadb -u root -p`
|
|
| List all databases | `show databases;`
|
|
| Create a database | `CREATE DATABASE database;`
|
|
| Create a user with a password | `CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';`
|
|
| Grant all permission of a database to user | `GRANT ALL ON database.* TO 'user'@'localhost';`
|
|
| Flush privileges | `FLUSH PRIVILEGES;`
|