mysqlcommands
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| mysqlcommands [2019/02/05 16:23] – [Passwords] z0hpvk | mysqlcommands [2025/03/08 22:24] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| mysql -u root -p football | mysql -u root -p football | ||
| - | select version(), | + | select version(), |
| - | select version(), now(); | + | |
| + | show databases; | ||
| create database football; | create database football; | ||
| use football; | use football; | ||
| - | select database(); | ||
| show tables; | show tables; | ||
| + | select database(); | ||
| + | |||
| mysqlshow -u root -p --count football | mysqlshow -u root -p --count football | ||
| Line 17: | Line 18: | ||
| show master status; | show master status; | ||
| flush binary logs; | flush binary logs; | ||
| - | |||
| - | grant all on football.* to ' | ||
| show status like ' | show status like ' | ||
| show variables like ' | show variables like ' | ||
| + | |||
| + | show engine innodb status\G | ||
| + | show processlist; | ||
| + | show open tables; | ||
| + | status; | ||
| + | |||
| + | set persist max_connection = 1000; (Like ALTER SYSTEM scope=BOTH) | ||
| + | set persist_only max_connection = 1000; (Like ALTER SYSTEM scope=SPFILE) | ||
| + | set global slow_query_log = ON; (Like ALTER SYSTEM scope=MEMORY) | ||
| + | set session sql_mode = ' | ||
| </ | </ | ||
| ==== Passwords and User Accounts ==== | ==== Passwords and User Accounts ==== | ||
| + | === Creating Users === | ||
| + | < | ||
| + | CREATE USER ' | ||
| + | CREATE USER ' | ||
| + | GRANT ALL PRIVILEGES ON *.* TO ' | ||
| + | GRANT SUPER ON *.* TO ' | ||
| + | </ | ||
| Global variables can be used to manage user passwords ... \\ | Global variables can be used to manage user passwords ... \\ | ||
| These can be overridden at the user level. \\ | These can be overridden at the user level. \\ | ||
| Line 42: | Line 58: | ||
| alter user ' | alter user ' | ||
| + | |||
| + | grant all on football.* to ' | ||
| + | |||
| + | select concat_ws(' | ||
| + | select user, password_expired, | ||
| + | </ | ||
| + | |||
| + | === Password Validation Component === | ||
| + | < | ||
| + | INSTALL COMPONENT ' | ||
| + | SELECT VALIDATE_PASSWORD_STRENGTH(' | ||
| + | SHOW VARIABLES LIKE ' | ||
| + | </ | ||
| + | [[https:// | ||
| + | |||
| + | ==== Backups and Recovery ==== | ||
| + | < | ||
| + | mysqldump -uroot -p --all-databases > mysqldb.sql | ||
| + | |||
| + | drop database football; <OR> mysqladmin -uroot -p drop football | ||
| + | mysqladmin -uroot -p create football | ||
| + | mysql -uroot -p football < mysqldb.sql | ||
| </ | </ | ||
mysqlcommands.1549383809.txt.gz · Last modified: (external edit)
