CREATE DATABASE IF NOT EXISTS ***_config DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
业务库
CREATE DATABASE IF NOT EXISTS ***_cms DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
建用户与权限
##默认无密码,修改密码
mysql -uroot -h 10.10.11.1 -P 3306 -p
use mysql;
SET PASSWORD FOR 'root'@'%' = '***passwd';
ALTER USER 'root'@'10.10.11.%' IDENTIFIED BY '***passwd';
备份相关:
#授予管理员权限(不建议权限太大用户) 设置访问白名单,例如localhost 10.10.104.网段
GRANT ALL PRIVILEGES ON *.* TO ***_user@"localhost" IDENTIFIED BY "***passwd";
GRANT ALL PRIVILEGES ON *.* TO ***_user@"10.10.104.%" IDENTIFIED BY "***passwd";
GRANT ALL PRIVILEGES ON *.* TO ***_user@"192.168.30.%" IDENTIFIED BY "***passwd";
#GRANT ALL PRIVILEGES ON *.* TO ***_user@"%" IDENTIFIED BY "***passwd";
用户配置库CREATE DATABASE IF NOT EXISTS ***_config DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;业务库CREATE DATABASE IF NOT EXISTS ***_cms DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;建用...