linux-shell脚本执行sql脚本

#!/bin/bash

echo "start init db, create_tables & init_tables"

service mysqld stop

sleep 1

service mysqld start

sleep 1 

db_curr=`pwd`

mysql <<EOF

source ${db_curr}/db_script/create_tables.sql;

source ${db_curr}/db_script/init_tables.sql;

use mysql;

update user set password=password("123456") where user='root';

flush privileges;

EOF

相关文章:

  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
  • 2021-05-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
猜你喜欢
  • 2021-11-21
  • 2022-12-23
  • 2021-12-06
  • 2021-11-27
  • 2022-12-23
  • 2021-04-23
相关资源
相似解决方案