meta data for this page
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| linux:databases [2015/06/22 08:22] – created niziak | linux:databases [2022/04/11 10:27] (current) – niziak | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Databases ====== | ||
| + | |||
| ===== Reset password ===== | ===== Reset password ===== | ||
| Start database without permission checking: | Start database without permission checking: | ||
| Line 22: | Line 24: | ||
| </ | </ | ||
| + | <code sql> | ||
| GRANT LOCK TABLES ON *.* TO ' | GRANT LOCK TABLES ON *.* TO ' | ||
| - | GRANT ALL PRIVILEGES ON *.* TO ' | + | GRANT ALL PRIVILEGES ON *.* TO ' |
| GRANT RELOAD, SHUTDOWN, PROCESS, SHOW DATABASES, SUPER, LOCK TABLES ON *.* TO ' | GRANT RELOAD, SHUTDOWN, PROCESS, SHOW DATABASES, SUPER, LOCK TABLES ON *.* TO ' | ||
| GRANT ALL ON testDB.* TO ' | GRANT ALL ON testDB.* TO ' | ||
| + | </ | ||
| ==== MySQL ==== | ==== MySQL ==== | ||
| + | <code sql> | ||
| show databases; | show databases; | ||
| show tables; | show tables; | ||
| + | </ | ||
| === Permissions === | === Permissions === | ||
| + | <code sql> | ||
| SHOW GRANTS; | SHOW GRANTS; | ||
| SHOW GRANTS FOR CURRENT_USER; | SHOW GRANTS FOR CURRENT_USER; | ||
| Line 39: | Line 46: | ||
| SELECT User, | SELECT User, | ||
| flush privileges; | flush privileges; | ||
| + | </ | ||
| + | === Optimize databases === | ||
| + | <code bash> | ||
| + | # | ||
| + | mysqlcheck --all-databases | ||
| + | mysqlcheck --all-databases -o | ||
| + | mysqlcheck --all-databases --auto-repair | ||
| + | mysqlcheck --all-databases --analyze | ||
| + | </ | ||