Mysql Grant Permission for Remote Access

February 24, 2021

Grant access to

  • all privileges
  • all tables
  • user from any ip
GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' IDENTIFIED BY 'password';

NOTE: Becareful as this is a huge security risk

Grant access to

  • all privileges
  • particular table
  • user from particular ip
GRANT ALL PRIVILEGES ON table.* TO 'user'@'8.8.8.8' IDENTIFIED BY 'password';

Grant access to

  • certain privileges
  • particular table
  • user from particular ip
GRANT SELECT,INSERT,UPDATE,DELETE ON table.* TO 'user'@'8.8.8.8' IDENTIFIED BY 'password';
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.