mysqlcommands
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
mysqlcommands [2019/02/06 09:00] – [MySQL Commands] 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; | show databases; | ||
Line 22: | Line 21: | ||
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 45: | Line 61: | ||
grant all on football.* to ' | grant all on football.* to ' | ||
- | select user from mysql.user; | + | select |
+ | 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.1549443620.txt.gz · Last modified: 2025/03/08 22:23 (external edit)