Skip to content

Instantly share code, notes, and snippets.

@mayhems1
Last active March 17, 2021 05:15
Show Gist options
  • Save mayhems1/f73ccf09eac36bbde0decc6da44b8853 to your computer and use it in GitHub Desktop.
Save mayhems1/f73ccf09eac36bbde0decc6da44b8853 to your computer and use it in GitHub Desktop.
MySQL

MySQL

Check version

mysql -V
SHOW VARIABLES LIKE "%version%";

Create database

CREATE DATABASE `mydatabase` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Check connections

show status where variable_name = 'threads_connected';
show processlist;

select id,user,host,db,command,time,state,info from information_schema.processlist;

The General Query Log

SET GLOBAL general_log = 'OFF';
SET GLOBAL general_log = 'ON';

Links

https://dba.stackexchange.com/questions/76788/create-a-mysql-database-with-charset-utf-8

https://dev.mysql.com/doc/refman/5.7/en/log-destinations.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment