Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2005-08-26 11:20:43

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [plugin] [ORPHAN] rss_admin_db_manager - database backups and more

Do I have to change anything in mysqldump Path and mysql Path?

Offline

#50 2005-08-26 12:07:09

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [plugin] [ORPHAN] rss_admin_db_manager - database backups and more

Okay, I got it working (partially) on my local install. (Not on the remote server because I don’t know what to set for the mysql paths (see above post), and I don’t know how to run the command from the command line there.

Local:

Backup is working. Restore however gives me this: FAILED TO RESTORE: 1. Running the command that appears in debugging mode from the command line gives this error:

ERROR 1064 at line 3251: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ’1 tinyint(1) NOT NULL default ‘0’, 2 tinyint(1) NOT NULL defa
(this really ends like that)

Remote:

BACKUP FAILED: file not there 127
[Edit] Lock tables yes or no makes no difference.

Last edited by doggiez (2005-08-26 12:11:16)

Offline

#51 2005-08-26 12:46:43

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

Re: [plugin] [ORPHAN] rss_admin_db_manager - database backups and more

doggiez – Did you try to run the backup from the command line on your remote server?

Offline

#52 2005-08-26 12:50:19

aba
Plugin Author
Registered: 2004-04-14
Posts: 119

Re: [plugin] [ORPHAN] rss_admin_db_manager - database backups and more

> (Not on the remote server because I don’t know what to set for the mysql paths (see above post), and I don’t know how to run the command from the command line there.

epending on the setup of the server you may try two things:

1. locate approach (if there is a locate and an uptodate database this should be really really fast):

<code>
<?php
$output = shell_exec(‘locate mysqldump’);
echo “<pre>$output</pre>”;
?>
</code>

2. find approach (on a big server the script might run in a timeout before it is finished – it does on mine, fortunately I have the root password…)

<code>
<?php
$output = shell_exec(‘find /usr -name mysqldump’);
echo “<pre>$output</pre>”;
?>
</code>

If the search isn’t giving you any result try / instead of /usr to search the whole server. It might be easier to ask the ISP support for the path, though… ;)

> BACKUP FAILED: file not there 127
> [Edit] Lock tables yes or no makes no difference.

> Do I have to change anything in mysqldump Path and mysql Path?

No

If I read the source correctly this just means that the destination directory (%docroot%/files by default) isn’t there (and I would really really like that error messages are not only meaningful for the plugin author – this isn’t the first time a normal user scratches his head when he tries to find out what the problem may be). Check the Backup Path.

[EDIT] grmbl…
please replace the <code><1></code> and <code><2></code> with <code>< pre > $ output < /pre ></code> without the blanks. This damned code stuff gives me a headache…

Last edited by aba (2005-08-26 12:54:55)

Offline

#53 2005-08-26 13:21:11

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [plugin] [ORPHAN] rss_admin_db_manager - database backups and more

> aba wrote:

1. locate approach (if there is a locate and an uptodate database this should be really really fast):

<code>
<?php
$output = shell_exec(‘locate mysqldump’);
echo “$output”;
?>
</code>

2. find approach (on a big server the script might run in a timeout before it is finished – it does on mine, fortunately I have the root password…)

<code>
<?php
$output = shell_exec(‘find /usr -name mysqldump’);
echo “$output”;
?>
</code>

Changes like this?
And am I right to put this in a file (like locate.php) and then call it like mysite.com/locate.php?

Answering myself: probably not, because what I get is this:

Warning: shell_exec(): Cannot execute using backquotes in Safe Mode in /home/httpd/vhosts/doggiez.nl/httpdocs/locate.php on line 2

> BACKUP FAILED: file not there 127
> [Edit] Lock tables yes or no makes no difference.

> Do I have to change anything in mysqldump Path and mysql Path?

No

If I read the source correctly this just means that the destination directory (%docroot%/files by default) isn’t there (and I would really really like that error messages are not only meaningful for the plugin author – this isn’t the first time a normal user scratches his head when he tries to find out what the problem may be). Check the Backup Path.

The destination directory is there. First, after I set it, I got BACKUP FAILED: folder not writable. Then I changed permissions from 755 to 777 and got BACKUP FAILED: file not there 127.

Offline

#54 2005-08-26 13:45:00

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

Re: [plugin] [ORPHAN] rss_admin_db_manager - database backups and more

BACKUP FAILED: file not there 127
Do I have to change anything in mysqldump Path and mysql Path?

doggiez – Based on that error code yes.

There are 3 paths you can set for the plugin. 1 is the file backup path and determines where your backups are stored.

The 2 other prefs – mysqldump path and mysql path allow you to set the full path to those executables. Based on some quick googling I see that an error code of 127 as you are receiving means A command could not be found. This means that the path to mysqldump is incorrect.

If you can determine the full path to it that should solve the problem. On *nix it could be something like <code>/usr/bin/mysqldump</code> and <code>/usr/bin/mysql</code>.

aba – I’ll include the mysql errors from the run sql tab in the next release.

Offline

#55 2005-08-26 14:06:20

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [plugin] [ORPHAN] rss_admin_db_manager - database backups and more

wilshire wrote:

If you can determine the full path to it that should solve the problem. On *nix it could be something like <code>/usr/bin/mysqldump</code> and <code>/usr/bin/mysql</code>.

Can’t find it. I’m going to ask my host.

Offline

#56 2005-08-26 16:28:29

aba
Plugin Author
Registered: 2004-04-14
Posts: 119

Re: [plugin] [ORPHAN] rss_admin_db_manager - database backups and more

> And am I right to put this in a file (like locate.php) and then call it like mysite.com/locate.php?

> Answering myself: probably not, because what I get is this:

> Warning: shell_exec(): Cannot execute using backquotes in Safe Mode in /home/httpd/vhosts/doggiez.nl/httpdocs/locate.php on line 2

The approach was correct but it only works if the administrator of your server allows it – sorry.

wilshire: Thanks

Offline

#57 2005-08-26 16:33:00

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [plugin] [ORPHAN] rss_admin_db_manager - database backups and more

This is my hosts reply to my question about the right mysql path:

Backup and restore of a database is possible via PHPMyAdmin, or through scripts that connect to the database in the usual way through the password/login combination of the database. Programs never have direct access to the mysql programs.

In other words: no path. So maybe this plugin is not for me? That’s a pity, but of course I can continue to use PHPMyAdmin for the backups.
But what I don’t understand is why TXP has access to the database without apparently needing the mysql path, and this plugin doesn’t?

Offline

#58 2005-08-26 16:58:22

maarten
Member
From: Netherlands
Registered: 2005-02-19
Posts: 130
Website

Re: [plugin] [ORPHAN] rss_admin_db_manager - database backups and more

Nice plugin which is more friendly than the PHPMyAdmin but on restoring a dump of my database I run in to the following error:

CREATE TABLE ashleytxp_priv(

id int( 8 ) NOT NULL AUTO_INCREMENT ,
priv varchar( 128 ) NOT NULL default ‘’,
1int( 1 ) NOT NULL default ‘0’,
2int( 1 ) NOT NULL default ‘0’,
3int( 1 ) NOT NULL default ‘0’,
4int( 1 ) NOT NULL default ‘0’,
5int( 1 ) NOT NULL default ‘0’,
6int( 1 ) NOT NULL default ‘0’,
PRIMARY KEY ( id )
) TYPE = MYISAM

MySQL retourneerde:

  1. - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ’1 int(1) NOT NULL default ‘0’, 2 int(1) NOT NULL default ‘0’,

Dumping from PHPMyAdmin works fine so the problem may be caused by the plugin. Or is this version related? (I’m using TXP 4.0 by the way)

Last edited by maarten (2005-08-26 16:59:48)

Offline

#59 2005-08-26 17:03:27

wilshire
Plugin Author
From: Akron, Ohio
Registered: 2004-08-27
Posts: 656
Website

Re: [plugin] [ORPHAN] rss_admin_db_manager - database backups and more

The plugin is not simply accessing the database. It makes calls to programs included in the mysql installation (with mysqldump being one of them). phpMyAdmin makes use of the same programs. I don’t know why your host wouldn’t allow access to the mysqldump command. Don’t you have access to run a dump from the command line?

In either case, if your host doesn’t allow access to the command you won’t be able to do backups with the plugin.

Offline

#60 2005-08-26 20:15:04

bauhouse
Archived Plugin Author
From: Abbotsford, BC Canada
Registered: 2004-06-29
Posts: 68
Website

Re: [plugin] [ORPHAN] rss_admin_db_manager - database backups and more

I set up a clean install of the Textpattern 4.0 deanload on TextDrive. The only plugin installed is rss_admin_db_manager.

I seem to be having a problem with restoring the database only on TextDrive. Everything is working fine on the local install in Mac OS X: Backup, Download, Restore, Delete.

When I try to restore a backup on TextDrive, I get an error:

<pre>FAILED TO RESTORE: 1</pre>

And everything is there except the textpattern table is empty.

So I go back to phpMyAdmin and restore the textpattern table. And everything is back to the way it was before the restore. Any ideas what is happening here?

Here is a clue:

When I run the SQL statements in phpMyAdmin, I get the following error:

<pre>
SQL-query:
LOCK TABLES `textpattern` WRITE

MySQL said:
  1. - Access denied for user ‘user’@‘localhost’ to database ‘database_name’
    </pre>

Last edited by bauhouse (2005-08-26 20:20:28)

Offline

Board footer

Powered by FluxBB