1,创建用户,只对指定的库和表有读的权限。
CREATE USER 'temp'@'127.0.0.1' IDENTIFIED BY '1'; GRANT USAGE ON *.* TO 'temp'@'127.0.0.1' IDENTIFIED BY '1' WITH MAX_QUERIES_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_USER_CONNECTIONS 0; GRANT Show View, Select ON TABLE `db_wegoto`.`we_ad` TO `temp`@`127.0.0.1`;
2,创建远程用户:
grant all privileges on imoslem_project_db.* to ‘username’@’%’identified by ‘password’ with grant option;
flush privileges;