一、创建账号、授权

  1. CREATE USER 'custom'@'localhost'
  2. IDENTIFIED BY 'password';
  3. GRANT ALL
  4. ON bankaccount.*
  5. TO 'custom'@'localhost';
  6. CREATE USER 'custom'@'host47.example.com'
  7. IDENTIFIED BY 'password';
  8. GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
  9. ON expenses.*
  10. TO 'custom'@'host47.example.com';
  11. CREATE USER 'custom'@'%.example.com'
  12. IDENTIFIED BY 'password';
  13. GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
  14. ON customer.addresses
  15. TO 'custom'@'%.example.com';