后浪云linux教程:宝塔bt.cn一键修改mysql数据库存放路径,更改默认数据目录脚本!

树叶云

宝塔bt.cn一键修改mysql数据库存放路径,更改默认数据目录脚本!

该shell脚本仅限于宝塔bt.cn linux面板使用,希望对有需要的朋友有所帮助,如有问题请留言!

2017/04/20修正只修改数据库存放路径,去除修改数据库安装路径,由于修改数据库安装路径后会导致宝塔无法识别。

新版本脚本:宝塔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!

抱歉,找不到/www/server/mysql目录!

Sorry, I can’t find the /www/server/mysql directory!

输入新的数据库路径(例如:/home/mysql):
Enter a new database path (for example, /home/mysql):

新的数据库路径不能为空!
New database path cannot be empty!

数据库目录更改不成功!
Database directory changes not successful!

数据库目录更改成功!
Database directory changed successfully!

正在转移mysql文件,可能需要一分钟!
Moving the MySQL file, you may need a minute!

正在转移数据库文件,可能需要一分钟!
Transferring the database file, you may need a minute!

新mysql安装路径:
Now MySQL installation path:

恢复成功!
Recover successfully!

恢复失败!
Recovery failure!

新数据库文件路径:

New database file path:

=====================================================================

下载链接:

wget http://IDC.NET/soft/mysql_Transfer.sh && sh mysql_Transfer.sh

本教程由IDC.NET树叶云创出品 服务器运维官方网址http://IDC.NET 欢迎大家多多关注本站 感谢大家的支持。

 

 

 

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/177676.html<

(0)
运维的头像运维
上一篇2025-03-25 18:13
下一篇 2025-03-25 18:14

相关推荐

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注