宝塔一键修改mysql数据库存放路径,更改默认数据目录脚本!
该shell脚本仅限于宝塔bt.cn linux面板使用,希望对有需要的朋友有所帮助,如有问题请留言!
主要参数功能:
1.默认修改数据库存放路径
sh mysql_Transfer.sh
2.还原数据库原存放路径
sh mysql_Transfer.sh old
脚本相关提示英文翻译:
抱歉,找不到/www/server/data目录!
Sorry, I can’t find the /www/server/data directory!
Sorry, I can’t find the /www/server/data directory!
抱歉,找不到/www/server/mysql目录!
Sorry, I can’t find the /www/server/mysql directory!
输入新的数据库路径(例如:/home/mysql):
Enter a new database path (for example, /home/mysql):
Enter a new database path (for example, /home/mysql):
新的数据库路径不能为空!
New database path cannot be empty!
New database path cannot be empty!
数据库目录更改不成功!
Database directory changes not successful!
Database directory changes not successful!
数据库目录更改成功!
Database directory changed successfully!
Database directory changed successfully!
正在转移mysql文件,可能需要一分钟!
Moving the MySQL file, you may need a minute!
Moving the MySQL file, you may need a minute!
正在转移数据库文件,可能需要一分钟!
Transferring the database file, you may need a minute!
Transferring the database file, you may need a minute!
新mysql安装路径:
Now MySQL installation path:
Now MySQL installation path:
恢复成功!
Recover successfully!
Recover successfully!
恢复失败!
Recovery failure!
Recovery failure!
新数据库文件路径:
New database file path:
===========================================================
下载链接:
wget http://www.tieww.com/soft/mysql_Transfer.sh && sh mysql_Transfer.sh
仅限2.X面板使用