MySQL Databases

From Run Your Own
Revision as of 14:21, 24 February 2019 by 320x200 (talk | contribs)
Jump to: navigation, search

Some MySQL handy oneliners:

  • List all users from running instance:
SELECT User, Host, Password FROM mysql.user;
  • Create new user called newuser
CREATE USER newuser@localhost IDENTIFIED BY 'superstrongpassword';
  • Creat new UTF-8 database called mydatabase
CREATE DATABASE mydatabase CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;