mysql-useful-commands
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| mysql-useful-commands [2023/10/17 08:41] – [Update field and replace string] baumi | mysql-useful-commands [2024/09/06 18:20] (current) – baumi | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| ~~ | ~~ | ||
| ====== MySQL useful commands ====== | ====== MySQL useful commands ====== | ||
| - | ===== Create Database User and Grant all rights to a DB ===== | + | ===== User & Permissions ===== |
| + | ==== Create Database User ==== | ||
| <code sql> | <code sql> | ||
| CREATE USER ' | CREATE USER ' | ||
| + | </ | ||
| + | ==== Delete Database User ==== | ||
| + | <code sql> | ||
| + | DROP USER ' | ||
| + | </ | ||
| + | ==== Grant Permissions ==== | ||
| + | <code sql> | ||
| GRANT ALL privileges ON dbname.* TO ' | GRANT ALL privileges ON dbname.* TO ' | ||
| FLUSH privileges; | FLUSH privileges; | ||
| </ | </ | ||
| - | ===== Set new DB user password | + | ==== Set new DB user password ==== |
| <code sql> | <code sql> | ||
| SET PASSWORD FOR ' | SET PASSWORD FOR ' | ||
| </ | </ | ||
| + | === Delete Database User === | ||
| + | |||
| + | |||
| ===== Update field and replace string ===== | ===== Update field and replace string ===== | ||
| <code sql> | <code sql> | ||
| Line 29: | Line 40: | ||
| mariadb: | mariadb: | ||
| - | $ docker exec -it mariadb-restore | + | $ docker exec -it mariadb-restore |
| - | # mysql -u root -p myql < / | + | # mysql -u root -p mysql < / |
| # echo "flush privileges" | # echo "flush privileges" | ||
| </ | </ | ||
| {{tag>kb mysql}} | {{tag>kb mysql}} | ||
mysql-useful-commands.1697524872.txt.gz · Last modified: by baumi
