-- 解决方案1：修改现有用户的host权限，允许从任何IP连接
-- 注意：这会允许从任何IP连接，安全性较低，建议仅在测试环境使用
UPDATE mysql.user SET Host = '%' WHERE User = 'shop_mallnew' AND Host = 'localhost';
FLUSH PRIVILEGES;

-- 或者解决方案2：创建一个新用户，允许从任何IP连接
-- CREATE USER 'shop_mallnew'@'%' IDENTIFIED BY 'shop_mallnew';
-- GRANT ALL PRIVILEGES ON huawei_shop_mallnew.* TO 'shop_mallnew'@'%';
-- FLUSH PRIVILEGES;

-- 或者解决方案3：创建一个新用户，仅允许从Docker容器的IP范围连接
-- 假设Docker容器的IP范围是172.17.0.0/16
-- CREATE USER 'shop_mallnew'@'172.17.0.0/255.255.0.0' IDENTIFIED BY 'shop_mallnew';
-- GRANT ALL PRIVILEGES ON huawei_shop_mallnew.* TO 'shop_mallnew'@'172.17.0.0/255.255.0.0';
-- FLUSH PRIVILEGES;
