Skip to content

Instantly share code, notes, and snippets.

@kevin3747118
Created April 23, 2018 07:32
Show Gist options
  • Save kevin3747118/f768e99ba6f9a00963285ff03c7584e3 to your computer and use it in GitHub Desktop.
Save kevin3747118/f768e99ba6f9a00963285ff03c7584e3 to your computer and use it in GitHub Desktop.
MySQL Note

MySQL

DDL

Enable root remote login :

  GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
  FLUSH PRIVILEGES;

Modify db max connections :

  show variables like ‘max_connections’;
  Set global max_connections = xxxx;

Disable safe mode :

  show variables like '%safe_updates%';
  SET SQL_SAFE_UPDATES = 0;

Show connections :

  Show status like ‘%onn%’;

DML

MySQL Insert Select :

  insert into alzk.keyareas (areaid, keyid, timecontrol, passed) select distinct areaid, 'aa000123456789', '[]', 'N' from alzk.keyareas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment