PDA

View Full Version : getting wrong datadir



fixel
March 5th, 2008, 07:01 AM
hi,

the backup script failed to get the right path to my mysql-datadir.

here a snipplet of the output:
-----------------
backup:INFO: ZRM for MySQL Community Edition - version 1.2.1
...
test1:backup:INFO: Getting mysql variables
test1:backup:INFO: "/usr/local/mysql/bin"/mysqladmin --user="backup-user" --password="*****" --port="3306" --socket="/var/run/mysqld/mysqld1.sock" variables
test1:backup:INFO: datadir is /var/mysql/
test1:backup:INFO: mysql_version is 5.0.50sp1a-enterprise-gpl
test1:backup:INFO: log_bin=OFF
test1:backup:WARNING: Binary logging is off.
test1:backup:INFO: InnoDB data file are /var/mysql/datadir1/ibdata1
test1:backup:INFO: InnoDB log dir is /var/mysql/datadir1
--------------------------------------------

But the <b>datadir</b> is not /var/mysql. It is /var/mysql/datadir1.

see (run the used command manually):

$ /usr/local/mysql/bin/mysqladmin --user="backup-user" --password="*****" --port="3306" --socket="/var/run/mysqld/mysqld1.sock" variables | grep datadir
<pre>
| datadir | /var/mysql/datadir1/
| innodb_data_home_dir | /var/mysql/datadir1/
| innodb_log_arch_dir | /var/mysql/datadir1/
| innodb_log_group_home_dir | /var/mysql/datadir1/
</pre>

What is wrong ?

kkg
March 6th, 2008, 04:09 AM
hi,

the backup script failed to get the right path to my mysql-datadir.

here a snipplet of the output:
-----------------
backup:INFO: ZRM for MySQL Community Edition - version 1.2.1
...
test1:backup:INFO: Getting mysql variables
test1:backup:INFO: "/usr/local/mysql/bin"/mysqladmin --user="backup-user" --password="*****" --port="3306" --socket="/var/run/mysqld/mysqld1.sock" variables
test1:backup:INFO: datadir is /var/mysql/
test1:backup:INFO: mysql_version is 5.0.50sp1a-enterprise-gpl
test1:backup:INFO: log_bin=OFF
test1:backup:WARNING: Binary logging is off.
test1:backup:INFO: InnoDB data file are /var/mysql/datadir1/ibdata1
test1:backup:INFO: InnoDB log dir is /var/mysql/datadir1
--------------------------------------------

But the <b>datadir</b> is not /var/mysql. It is /var/mysql/datadir1.

see (run the used command manually):

$ /usr/local/mysql/bin/mysqladmin --user="backup-user" --password="*****" --port="3306" --socket="/var/run/mysqld/mysqld1.sock" variables | grep datadir
<pre>
| datadir | /var/mysql/datadir1/
| innodb_data_home_dir | /var/mysql/datadir1/
| innodb_log_arch_dir | /var/mysql/datadir1/
| innodb_log_group_home_dir | /var/mysql/datadir1/
</pre>

What is wrong ?

That is something very srange.

Could you post the full out put of
$ /usr/local/mysql/bin/mysqladmin --user="backup-user" --password="*****" --port="3306" --socket="/var/run/mysqld/mysqld1.sock" variables

Also please post the verbose output of your backup run.

--kkg

fixel
March 6th, 2008, 05:34 AM
Attached the mysql variables ...
next reply is zrm backup logfile ...

fixel
March 6th, 2008, 05:35 AM
see attachment

kkg
March 7th, 2008, 01:52 AM
Attached the mysql variables ...
next reply is zrm backup logfile ...

Ok, I think I understood the issue. The issue is due to the fact that we are splitting on datadir. If you rename your datadir to /var/lib/data_dir1 you will not see this issue.

Let me know if this solves your problem.
--kkg

kkg
March 7th, 2008, 02:05 AM
Ok, I think I understood the issue. The issue is due to the fact that we are splitting on datadir. If you rename your datadir to /var/lib/data_dir1 you will not see this issue.

Let me know if this solves your problem.
--kkg

If renaming the datadir is not an option, you can try the following:

Replace the function extractValue() in /usr/lib/mysql-zrm/ZRM/MySQL.pm with the following code

sub extractValue()
{
my $tmp;
my $data;
if( !$_[1] ){
return;
}
my @data1 = split( $_[0], $_[1] );
if( !defined $data1[1] || ! $data1[1] ) {
return;
}
shift @data1;
$data = join( $_[0], @data1 );
my @xx = split( /\|/, $data );
$data = $xx[1];
chomp( $data );
$data=~ s/^\s+//;
$data=~ s/\s+$//;
return $data;
}

Let me know if this works for you.
--kkg

kkg
March 7th, 2008, 02:10 AM
Since the formatting seems to have got screwed up I am putting it in an attachment.

--kkg

kkg
March 7th, 2008, 05:09 AM
Since the formatting seems to have got screwed up I am putting it in an attachment.

--kkg


Actually the whole function can be simplified to

sub extractValue()
{
if( $_[1] =~ /\n\|*\s+$_[0]\s+\|*\s+(\S+)\s+\|*\n/ ){
return $1;
}
}

Could you please use this instead of the previous code and let me know if this works for you?

--kkg

fixel
March 14th, 2008, 04:33 AM
Thanks,
with the code replacment it works fine ...

will this be patched in the next release ?

best regards
felix

fixel
March 14th, 2008, 04:34 AM
Actually the whole function can be simplified to

sub extractValue()
{
if( $_[1] =~ /\n\|*\s+$_[0]\s+\|*\s+(\S+)\s+\|*\n/ ){
return $1;
}
}

Could you please use this instead of the previous code and let me know if this works for you?

--kkg

OOps, this new code I have to check ...