User Tools

Site Tools


mysqlcommands

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mysqlcommands [2019/02/06 13:43] – [Passwords and User Accounts] z0hpvkmysqlcommands [2025/03/08 22:24] (current) – external edit 127.0.0.1
Line 21: Line 21:
 show status like '%Connections%'; show status like '%Connections%';
 show variables like '%bin%'; show variables like '%bin%';
 +
 +show engine innodb status\G
 +show processlist; <OR> SELECT * FROM information_schema.processlist ORDER BY id;
 +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 = 'TRADITIONAL'; (Like ALTER SESSION)
 </code> </code>
  
 ==== Passwords and User Accounts ==== ==== Passwords and User Accounts ====
 +=== Creating Users ===
 +<code>
 +CREATE USER 'ian'@'localhost' IDENTIFIED BY 'password123';
 +CREATE USER 'ian'@'%' IDENTIFIED BY 'password123';
 +GRANT ALL PRIVILEGES ON *.* TO 'ian'@'localhost';
 +GRANT SUPER ON *.* TO 'ian'@'localhost';
 +</code>
 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 44: Line 61:
 grant all on football.* to 'ian'@'localhost'; grant all on football.* to 'ian'@'localhost';
  
-select user from mysql.user;+select concat_ws('@',user, host) from mysql.user;
 select user, password_expired, password_last_changed, password_lifetime, account_locked from mysql.user; select user, password_expired, password_last_changed, password_lifetime, account_locked from mysql.user;
 </code> </code>
mysqlcommands.1549460585.txt.gz · Last modified: 2025/03/08 22:23 (external edit)