[PHP-DB] BACKUP/RESTORE - file rights

2003-06-26 Thread Armand Turpel
Hi,

Doing a backup of db tables under mysql using

$sql = '
   BACKUP TABLE
   test_table
   TO
   backup
   '; 
give the backup files the rights of the mysql server. I my environemt 
this is:
user: mysql
group: daemon

If the apache isn't a member of the daemon group, php can not do some 
work on this files, ex.: file compression.

Question:
Is this the case, that the mysql and the apache server where members of 
the same group in most server environements?

Thanks,
Armand
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] MySQL Backup, final script !!!

2003-06-26 Thread Armand Turpel
Hi,

You have only to modify it to your environement
It works with mysql = 3.23.52
// Get all table names of the database
   //
   $sql = '
   SHOW TABLES
   FROM
  test_db
   ;  
   $db-query($sql);
  
  
   while($row  = $db-fetchRow( 'DB_GETMODE_NUM'))
   {

   $sql = '
   BACKUP TABLE
   '.$row[0].'
   TO
   /db_backup
   '; 
   $db-query($sql);
   }

Armand



Nabil wrote:

I have been searching inside the mailing lists regarding the a PHP code that
dump all or a selected databases from MySQL ...
and haven't managed to get a script like PhpMyAdmin does... please any ready
script or idea ...
?php exec(mysqldump -u root -ppassword -A  backup.sql); ?
//Because it didn't work with me (on windows by example).
All what I am thinking to do is a script that retrieved the database names
then retrieve the tables names, then fields names and dump the data in an
schema like mysqldump does
any suggestions??

Cheers...
Nabil


 



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] MySQL Backup, final script !!!

2003-06-26 Thread Armand Turpel
I use an db abstraction class. You have to replace this by yours. Of 
course you got a Fatal error: Call to a member function on a 
non-object because such an object dosen't exist in your script. First 
you have to connect to a database using mysql_connect() and using 
mysql_query and mysql_fetch_row.

Armand

Nabil wrote:

thanks a lot for your response but i got

Fatal error: Call to a member function on a non-object in
c:\inetpub\wwwroot\dump.php on line 3
not that mysql is 3.23.53
my script is :
/
?php
$sql = 'SHOW TABLES FROM chat';
$db-query($sql);
while ($row  = $db - fetchRow ('DB_GETMODE_NUM') )
{
$sql = ' BACKUP TABLE '.$row[0].' TO /db_backup ';
$db-query($sql);
}
?
/
 



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] MYSQL_CLIENT_COMPRESS

2003-06-06 Thread Armand Turpel
Hi,
Is there any body who have experience with the flags in mysql_connect() in
php =  4.3 . Especially the MYSQL_CLIENT_COMPRESS flag.

Give it sense, to use this feature if both, apache/php and the mysql server
reside on the same machine?

Thanks,
Armand



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] mysql_connect() -- flags

2003-06-01 Thread Armand Turpel
Hi,
Is there any body who have experience with the flags in mysql_connect() in
php =  4.3 . Especially the MYSQL_CLIENT_COMPRESS flag.

I dont know if it works or not. I cant make any difference in performance
tests on localhost. Should php must
be compiled with a special flag to get work this?

Thanks
Armand



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php