mirror of
https://github.com/muerwre/muerwre.github.io.git
synced 2025-04-25 19:06:41 +07:00
added whole content
This commit is contained in:
parent
1b5df685cb
commit
8b25e0631a
70 changed files with 5962 additions and 19 deletions
37
content/SQL/MySQL and MariaDB setup.md
Normal file
37
content/SQL/MySQL and MariaDB setup.md
Normal file
|
@ -0,0 +1,37 @@
|
|||
## Install MariaDB on Ubuntu 20.04 LTS
|
||||
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt install mariadb-server
|
||||
sudo mysql_secure_installation
|
||||
```
|
||||
|
||||
## Access Database from outside
|
||||
|
||||
Open `/etc/mysql/mariadb.conf.d/50-server.cnf` and change the `bind-address` to:
|
||||
|
||||
```nginx
|
||||
...
|
||||
bind-address = 0.0.0.0
|
||||
...
|
||||
```
|
||||
|
||||
## Create Administrative User
|
||||
|
||||
1. Create a new user `newuser` for the host `localhost` with a new `password`:
|
||||
|
||||
```mysql
|
||||
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
|
||||
```
|
||||
|
||||
2. Grant all permissions to the new user
|
||||
|
||||
```mysql
|
||||
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
|
||||
```
|
||||
|
||||
3. Update permissions
|
||||
|
||||
```mysql
|
||||
FLUSH PRIVILEGES;
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue