Commit ef6a22e6 by tingweiwang

增加mysql_host默认为127.0.0.1

1 parent 00dc86b8
Showing with 13 additions and 12 deletions
......@@ -3,30 +3,31 @@ workspace=/workspace/seetaas
#记得修改seetaas-backend的sql语句
mysql_user=root
mysql_password=seetatech
mysql_host=127.0.0.1 #为了兼容容器化部署mysql
########################################设置数据库相关#############################################
#包括授予账号远程连接权限,各个服务组件的数据库语句插入
echo "mysql用户授权远程机器登陆"
mysql -u $mysql_user -p$mysql_password -e "use mysql;"
mysql -u $mysql_user -p$mysql_password -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' identified by 'seetatech';"
mysql -u $mysql_user -p$mysql_password -e "flush privileges;"
mysql -u $mysql_user -p$mysql_password -h $mysql_host -e "use mysql;"
mysql -u $mysql_user -p$mysql_password -h $mysql_host -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' identified by 'seetatech';"
mysql -u $mysql_user -p$mysql_password- h $mysql_host -e "flush privileges;"
service mysql restart
echo "创建数据库autodl-core"
mysql -u $mysql_user -p$mysql_password -e 'CREATE SCHEMA `autodl-core`;' #数据库名字带-需要通过``符号转义
mysql -u $mysql_user -p$mysql_password -h $mysql_host -e 'CREATE SCHEMA `autodl-core`;' #数据库名字带-需要通过``符号转义
echo "创建数据库user-center"
mysql -u $mysql_user -p$mysql_password -e 'CREATE SCHEMA `user-center`;'
mysql -u $mysql_user -p$mysql_password -h $mysql_host -e 'CREATE SCHEMA `user-center`;'
echo "创建数据库seetaas"
mysql -u $mysql_user -p$mysql_password -e 'CREATE SCHEMA `seetaas`;'
mysql -u $mysql_user -p$mysql_password -h $mysql_host -e 'CREATE SCHEMA `seetaas`;'
echo "创建数据库quota"
mysql -u $mysql_user -p$mysql_password -e 'CREATE SCHEMA `quota`;'
mysql -u $mysql_user -p$mysql_password -h $mysql_host -e 'CREATE SCHEMA `quota`;'
############设置autodl-core数据库#################################
echo "加载autodl-core所需sql"
mysql -u $mysql_user -p$mysql_password autodl-core <$workspace/src/autodl-core/sql/1106.sql
mysql -u $mysql_user -p$mysql_password autodl-core <$workspace/src/autodl-core/sql/1121.sql
mysql -u $mysql_user -p$mysql_password autodl-core <$workspace/src/autodl-core/sql/190321.sql
mysql -u $mysql_user -p$mysql_password autodl-core <$workspace/src/autodl-core/sql/190402.sql
mysql -u $mysql_user -p$mysql_password -h $mysql_host autodl-core <$workspace/src/autodl-core/sql/1106.sql
mysql -u $mysql_user -p$mysql_password -h $mysql_host autodl-core <$workspace/src/autodl-core/sql/1121.sql
mysql -u $mysql_user -p$mysql_password -h $mysql_host autodl-core <$workspace/src/autodl-core/sql/190321.sql
mysql -u $mysql_user -p$mysql_password -h $mysql_host autodl-core <$workspace/src/autodl-core/sql/190402.sql
echo "为autodl-core设置service记录"
#seetaas3是service_id,需要保证configmap与初始化sql里的service_id一致,内部和私有部署为seetaas3,金山云为kpl
mysql -u $mysql_user -p$mysql_password -e 'INSERT INTO `autodl-core`.`service` (`service_id`, `noti_api`) VALUES ("seetaas3", "http://kpl--monitor.kpl.svc.cluster.local:8920/status");'
mysql -u $mysql_user -p$mysql_password -h $mysql_host -e 'INSERT INTO `autodl-core`.`service` (`service_id`, `noti_api`) VALUES ("seetaas3", "http://kpl--monitor.kpl.svc.cluster.local:8920/status");'
#######################设置user-center数据库相关########################
#echo "加载user-center所需sql"
#mysql -u $mysql_user -p$mysql_password user-center <$workspace/src/user-center/sql/20190411.sql
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!