douxian9943 2014-08-03 12:58
浏览 74
已采纳

mysqldump-php无法使用共享的托管公司数据库。 没有命令行访问权限或SUPER权限

Does anyone know if mysqldump-php can work with shared hosting? I can get it to work on my local computer (I can get mysqldump to work locally also) but I need a method to backup a database that's hosted with a popular webhosting company. The only method that they offer to their customers is to sign onto phpMyAdmin and download your .sql manually. daily. yourself. no automation allowed. I'm a newbie and I'm going nuts trying to find a solution.

mysqldump-php called for

namespace Ifsnop\Mysqldump;

use Exception;
use PDO;
use PDOException;

It didn't mention needing command line access or SUPER privilege(s).

Am I using incorrect settings?

Here's the link to the code that I'm using on Github.

https://github.com/ifsnop/mysqldump-php#dump-settings

Any help would be so appreciated!

  • 写回答

1条回答 默认 最新

  • douju1968 2014-08-03 13:16
    关注

    I've had a look in the code of ifsnop, and it uses SET GLOBAL TRANSACTION ISOLATION LEVEL REPEATABLE READ before starting the transaction. Global settings are only allowed with the SUPER-privilege (which you don't have on a shared environment, with a good reason ;) ).

    You can either:

    1. If you have only MyISAM-tables, there is no need for a transaction, so it can be turned off in the config.

      $dumpConfig = array( 'single-transaction' => false ); $md = new Mysqldump($db, $user, $pass, $host, 'mysql', $dumpConfig);

    2. or; Change that word GLOBAL into SESSION (thus modifying the downloaded code).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 WPF动态创建页面内容
  • ¥15 如何对TBSS的结果进行统计学的分析已完成置换检验,如何在最终的TBSS输出结果提取除具体值及如何做进一步相关性分析
  • ¥15 SQL数据库操作问题
  • ¥100 关于lm339比较电路出现的问题
  • ¥15 Matlab安装yalmip和cplex功能安装失败
  • ¥15 加装宝马安卓中控改变开机画面
  • ¥15 STK安装问题问问大家,这种情况应该怎么办
  • ¥15 关于罗技鼠标宏lua文件的问题
  • ¥15 halcon ocr mlp 识别问题
  • ¥15 已知曲线满足正余弦函数,根据其峰值,还原出整条曲线