CREATE USER 'user_name'@'%' IDENTIFIED BY '12345'; -- % 代表所有ip可以访问 GRANT all ON *.* TO 'user_name'@'%'; flush privileges; -- 重启mysql