a1exlism
7/5/2016 - 3:56 PM

mysql_user

create user:
  CREATE USER 'newuser'@'localhost'
  IDENTIFIED BY 'password';
  
grant privileges:
  GRANT ALL PRIVILEGES ON your_database.tables
  TO 'newuser'@'localhost';

-- 2in1:
  GRANT SELECT ON auth.*
  TO 'webauth'@'localhost'
  IDENTIFIED BY 'webauth';

-- reload:
  FLUSH PRIVILEGES;

-- show privileges:
  SHOW GRANTS FOR `webauth`@`localhost`;
  
-- show all users:

SELECT User, Host, Password FROM mysql.user;