- 通过shell 创建数据库
- Your password does not satisfy the current policy requirements
#!/bin/bash
read -p "请您输入数据库密码:" p
read -p "请您输入要创建的数据库名称:" name
echo "xxxx_${name}0101"
mysql -uroot -p$p << EOF
create database $name character set utf8;
grant all privileges on $name.* to $name@'%' identified by "xxxx_${name}xxx";
flush privileges;
EOF
if [ $? -eq 0 ];then
echo "数据库创建成功"
else
echo "数据库创建失败"
fi
Your password does not satisfy the current policy requirements
数据库密码过于简单
SHOW VARIABLES LIKE 'validate_password%';
set global validate_password_policy=LOW;