Re: [PHP-DB] mysqldump
On Wed, Jan 2, 2013 at 12:50 AM, Ethan Rosenberg, PhD < erosenb...@hygeiabiomedical.com> wrote: > Dear List - > > I am using the following command: > > mysqldump -u root -p Store > StoreBkup.sql; > > to backup the database called Store. > > Mysql insists on giving a syntax error. > > Advice and help, please. > > Thanks. > > Ethan > -- > What error do you get, and when? There seems to be nothing wrong with the command itself. - Matijn
[PHP-DB] mysqldump
Dear List - I am using the following command: mysqldump -u root -p Store > StoreBkup.sql; to backup the database called Store. Mysql insists on giving a syntax error. Advice and help, please. Thanks. Ethan -- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysqldump permissions
Give the user show view permission http://dev.mysql.com/doc/refman/5.1/en/privileges-provided.html#priv_show-view On 06/06/2011 7:57 AM, "Ron Piggott" wrote: > > I created a VIEW “table” yesterday. Last night when the cron job ran to back up the database I received this error: > > > mysqldump: Couldn't execute 'show create table `bible_anagrams_rss_feed_summary`': SHOW VIEW command denied to user > > > I use the following syntax to do the backup of the database each day within the context of a cron job: > > > date=`date -I` ; mysqldump –uUSER –pPASS --all-databases | gzip > /home/path/backup_$date.sql.gz > > > Even when I have given the mysql backup user all the permissions available within the control panel of my web site hosting company I still get the same error. These are the permissions I have available. > > SELECT > INSERT > UPDATE > DELETE > INDEX > CREATE TEMPORARY TABLE > EXECUTE > CREATE > ALTER > DROP > LOCK TABLES > REFERENCES > CREATE ROUTINE > > How to resolve the error? > > Ron > > The Verse of the Day > “Encouragement from God’s Word” > http://www.TheVerseOfTheDay.info
[PHP-DB] mysqldump permissions
I created a VIEW “table” yesterday. Last night when the cron job ran to back up the database I received this error: mysqldump: Couldn't execute 'show create table `bible_anagrams_rss_feed_summary`': SHOW VIEW command denied to user I use the following syntax to do the backup of the database each day within the context of a cron job: date=`date -I` ; mysqldump –uUSER –pPASS --all-databases | gzip > /home/path/backup_$date.sql.gz Even when I have given the mysql backup user all the permissions available within the control panel of my web site hosting company I still get the same error. These are the permissions I have available. SELECT INSERT UPDATE DELETE INDEX CREATE TEMPORARY TABLE EXECUTE CREATE ALTER DROP LOCK TABLES REFERENCES CREATE ROUTINE How to resolve the error? Ron The Verse of the Day “Encouragement from God’s Word” http://www.TheVerseOfTheDay.info
Re: [PHP-DB] MySQLDump through PHP/HTML UI
Hi, Rick - - - Well, there really is not a lot to tell. Yes, it is being prompted by a HTML page. I show the table names with checkboxes or an "all." As a result, I build the simplest 'dump" statement; mysqldump databasename>path/outfilename,sql --tables -- user=dunknob --password=doorknob Anyway, it did turn out to be a permissions problem, so marked this one with a big SOLVED. it didn't smell like one, however, as the file was being written, the "dump' heading lines were there, just the parameters were ignored. Ah, well Thanks for your suggestions. Ken On Dec 10, 2008, at 9:42 PM, lists-php wrote: you don't give a lot of information of how you are running your utility, but you're likely to run into file permission issues in a linux context that you won't have in a windoz one. if you're running it through a web page you'll be trying to write the dump file as the user that your web server runs under (by default "apache"). generally (and in a secure setup) that user will not have the ability to write to files under the documentroot. - Rick Original Message Date: Wednesday, December 10, 2008 09:25:37 PM -0600 From: phphelp -- kbk To: php-db@lists.php.net Subject: Re: [PHP-DB] MySQLDump through PHP/HTML UI Hi, Chris -- -- -- -- Yes, thanks for the suggestion: it runs from the command line just fine. I run them often, and it works in Windows. However, I just was able to gain access again to the error log (long story), and I see that the page is throwing an unrelated error that it does not throw in Windows. I will run down that road and see if that error is somehow getting in the way. Thank you for your ideas. Ken On Dec 10, 2008, at 3:50 PM, Chris wrote: phphelp -- kbk wrote: Hello - - -- - I have a utility which creates a MySQLDump of selected tables or the whole database. This works fine on my development machine, a W2K box. It does not work on the testing server, a linux box. I'll post code if you want, but it is very simple: 1. I create the "dump" language, including the file into which the data is dumped into a variable. 2. I perform system($dump_language). I also tried it exec ($dump_language). Both produce the same result: What cmd are you putting together (I assume something for mysqldump)? If you run it manually from the cmd line, does it work? Does it give an error? -- Postgresql & php tutorials http://www.designmagick.com/ End Original Message -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQLDump through PHP/HTML UI
phphelp -- kbk wrote: Hi, Chris -- -- -- -- Yes, thanks for the suggestion: it runs from the command line just fine. I run them often, and it works in Windows. However, I just was able to gain access again to the error log (long story), and I see that the page is throwing an unrelated error that it does not throw in Windows. I will run down that road and see if that error is somehow getting in the way. You're not calling mysqldump.exe on *nix are you? :) Hence the suggestion to print out the full cmd and try it manually to make sure it's being put together appropriately.. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQLDump through PHP/HTML UI
On Dec 10, 2008, at 3:21 PM, Yves Sucaet wrote: What PHP-function/command are you using to invoke the mysqldump command? As I said in the original post, I have used both system() and exec(), both with the same result. Try including a flush() statement right before you start dumping. I'll try it, thanks. Ken -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQLDump through PHP/HTML UI
Hi, Chris -- -- -- -- Yes, thanks for the suggestion: it runs from the command line just fine. I run them often, and it works in Windows. However, I just was able to gain access again to the error log (long story), and I see that the page is throwing an unrelated error that it does not throw in Windows. I will run down that road and see if that error is somehow getting in the way. Thank you for your ideas. Ken On Dec 10, 2008, at 3:50 PM, Chris wrote: phphelp -- kbk wrote: Hello - - -- - I have a utility which creates a MySQLDump of selected tables or the whole database. This works fine on my development machine, a W2K box. It does not work on the testing server, a linux box. I'll post code if you want, but it is very simple: 1. I create the "dump" language, including the file into which the data is dumped into a variable. 2. I perform system($dump_language). I also tried it exec ($dump_language). Both produce the same result: What cmd are you putting together (I assume something for mysqldump)? If you run it manually from the cmd line, does it work? Does it give an error? -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQLDump through PHP/HTML UI
phphelp -- kbk wrote: Hello - - -- - I have a utility which creates a MySQLDump of selected tables or the whole database. This works fine on my development machine, a W2K box. It does not work on the testing server, a linux box. I'll post code if you want, but it is very simple: 1. I create the "dump" language, including the file into which the data is dumped into a variable. 2. I perform system($dump_language). I also tried it exec($dump_language). Both produce the same result: What cmd are you putting together (I assume something for mysqldump)? If you run it manually from the cmd line, does it work? Does it give an error? -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQLDump through PHP/HTML UI
What PHP-function/command are you using to invoke the mysqldump command? Try including a flush() statement right before you start dumping. I don't know why it works, but it's solved some of my problems in the past. Must be something with buffer management. hth, Yves - Original Message - From: "Ken Kixmoeller.com" <[EMAIL PROTECTED]> To: Sent: Wednesday, December 10, 2008 11:38 AM Subject: Re: [PHP-DB] MySQLDump through PHP/HTML UI Merci, Yves - -- It takes the blink of an eye. It seems like none of the string is running at all. Also, yeah, the slashes thing used to trip me up, too, when I first started working around Linux boxes. However, the file *is* being created and it is in the right place, just nothing in it. Ken On Dec 10, 2008, at 9:43 AM, Yves Sucaet wrote: Hi Ken, How long does the mysqldump operation last? Maybe it's a script timeout problem? And maybe you have different settings on both machines? Other idea: what about pathnames? Linux uses "/" to separate paths, Windows uses "\". That's all I have for now, Yves - Original Message - From: "phphelp -- kbk" <[EMAIL PROTECTED]> To: Sent: Wednesday, December 10, 2008 9:32 AM Subject: [PHP-DB] MySQLDump through PHP/HTML UI Hello - - -- - I have a utility which creates a MySQLDump of selected tables or the whole database. This works fine on my development machine, a W2K box. It does not work on the testing server, a linux box. I'll post code if you want, but it is very simple: 1. I create the "dump" language, including the file into which the data is dumped into a variable. 2. I perform system($dump_language). I also tried it exec ($dump_language). Both produce the same result: The file is created (the directory is one for which the application has r/w rights). In Windoze, the file is complete and perfect. On the Linux box, only the header information of the dump file is written, nothing about any database or table. Any ideas? Thank you, Ken -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQLDump through PHP/HTML UI
Merci, Yves - -- It takes the blink of an eye. It seems like none of the string is running at all. Also, yeah, the slashes thing used to trip me up, too, when I first started working around Linux boxes. However, the file *is* being created and it is in the right place, just nothing in it. Ken On Dec 10, 2008, at 9:43 AM, Yves Sucaet wrote: Hi Ken, How long does the mysqldump operation last? Maybe it's a script timeout problem? And maybe you have different settings on both machines? Other idea: what about pathnames? Linux uses "/" to separate paths, Windows uses "\". That's all I have for now, Yves - Original Message - From: "phphelp -- kbk" <[EMAIL PROTECTED]> To: Sent: Wednesday, December 10, 2008 9:32 AM Subject: [PHP-DB] MySQLDump through PHP/HTML UI Hello - - -- - I have a utility which creates a MySQLDump of selected tables or the whole database. This works fine on my development machine, a W2K box. It does not work on the testing server, a linux box. I'll post code if you want, but it is very simple: 1. I create the "dump" language, including the file into which the data is dumped into a variable. 2. I perform system($dump_language). I also tried it exec ($dump_language). Both produce the same result: The file is created (the directory is one for which the application has r/w rights). In Windoze, the file is complete and perfect. On the Linux box, only the header information of the dump file is written, nothing about any database or table. Any ideas? Thank you, Ken -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQLDump through PHP/HTML UI
Hi Ken, How long does the mysqldump operation last? Maybe it's a script timeout problem? And maybe you have different settings on both machines? Other idea: what about pathnames? Linux uses "/" to separate paths, Windows uses "\". That's all I have for now, Yves - Original Message - From: "phphelp -- kbk" <[EMAIL PROTECTED]> To: Sent: Wednesday, December 10, 2008 9:32 AM Subject: [PHP-DB] MySQLDump through PHP/HTML UI Hello - - -- - I have a utility which creates a MySQLDump of selected tables or the whole database. This works fine on my development machine, a W2K box. It does not work on the testing server, a linux box. I'll post code if you want, but it is very simple: 1. I create the "dump" language, including the file into which the data is dumped into a variable. 2. I perform system($dump_language). I also tried it exec ($dump_language). Both produce the same result: The file is created (the directory is one for which the application has r/w rights). In Windoze, the file is complete and perfect. On the Linux box, only the header information of the dump file is written, nothing about any database or table. Any ideas? Thank you, Ken -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySQLDump through PHP/HTML UI
Hello - - -- - I have a utility which creates a MySQLDump of selected tables or the whole database. This works fine on my development machine, a W2K box. It does not work on the testing server, a linux box. I'll post code if you want, but it is very simple: 1. I create the "dump" language, including the file into which the data is dumped into a variable. 2. I perform system($dump_language). I also tried it exec ($dump_language). Both produce the same result: The file is created (the directory is one for which the application has r/w rights). In Windoze, the file is complete and perfect. On the Linux box, only the header information of the dump file is written, nothing about any database or table. Any ideas? Thank you, Ken -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysqldump via php
Thanks all for the help! exec() seems the best option. Jeffrey Miguel Guirao wrote: You could use exec() within PHP! -Original Message- From: Adrian Bruce [mailto:[EMAIL PROTECTED] Sent: Jueves, 29 de Junio de 2006 06:31 a.m. To: Jeffrey Cc: PHP DB Subject: Re: [PHP-DB] mysqldump via php mysqldump is a .exe, and therefore it will not work within mysql_query(); You may be able to use mysqldump from PHP using the system function check out http://uk.php.net/system Ade Jeffrey wrote: I would like to do a backup of an entire MySQL database via php. My thought was to use mysqldump, write the data to a file and save the file. However... $query="mysqldump $dbase"; $result=mysql_query($query) or die(mysql_error()); ...immediately results in an "error in your SQL syntax near mysqldump [database name]". The reason I want to do a MySQL back up via php is that I have a web application in which the user can archive a project, which involves moving a lot data from one set of tables to another set of tables. The user can also delete a project, which removes lots of data from the DB altogether. Although there are lots of "Are you sure you really want to do this?" messages the user must click upon, I am sure I will eventually get a user telling me she accidentally archived/deleted stuff and can I help. So, my thought was to do a incorporate a mysqldump in the archiving/delete page. That way there would be a snapshot of the pre-action db, making it easy to put things right. Can you help with my query - or by suggesting an alternative solution? Thanks, Jeffrey -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] mysqldump via php
You could use exec() within PHP! -Original Message- From: Adrian Bruce [mailto:[EMAIL PROTECTED] Sent: Jueves, 29 de Junio de 2006 06:31 a.m. To: Jeffrey Cc: PHP DB Subject: Re: [PHP-DB] mysqldump via php mysqldump is a .exe, and therefore it will not work within mysql_query(); You may be able to use mysqldump from PHP using the system function check out http://uk.php.net/system Ade Jeffrey wrote: > I would like to do a backup of an entire MySQL database via php. My > thought was to use mysqldump, write the data to a file and save the > file. However... > > $query="mysqldump $dbase"; > $result=mysql_query($query) or die(mysql_error()); > > ...immediately results in an "error in your SQL syntax near mysqldump > [database name]". > > The reason I want to do a MySQL back up via php is that I have a web > application in which the user can archive a project, which involves > moving a lot data from one set of tables to another set of tables. The > user can also delete a project, which removes lots of data from the DB > altogether. Although there are lots of "Are you sure you really want > to do this?" messages the user must click upon, I am sure I will > eventually get a user telling me she accidentally archived/deleted > stuff and can I help. > > So, my thought was to do a incorporate a mysqldump in the > archiving/delete page. That way there would be a snapshot of the > pre-action db, making it easy to put things right. > > Can you help with my query - or by suggesting an alternative solution? > > Thanks, > > Jeffrey > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Este mensaje es exclusivamente para el uso de la persona o entidad a quien esta dirigido; contiene informacion estrictamente confidencial y legalmente protegida, cuya divulgacion es sancionada por la ley. Si el lector de este mensaje no es a quien esta dirigido, ni se trata del empleado o agente responsable de esta informacion, se le notifica por medio del presente, que su reproduccion y distribucion, esta estrictamente prohibida. Si Usted recibio este comunicado por error, favor de notificarlo inmediatamente al remitente y destruir el mensaje. Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Radiomovil Dipsa, S.A. de C.V. o alguna de sus empresas controladas, controladoras, afiliadas y subsidiarias. Este mensaje intencionalmente no contiene acentos. This message is for the sole use of the person or entity to whom it is being sent. Therefore, it contains strictly confidential and legally protected material whose disclosure is subject to penalty by law. If the person reading this message is not the one to whom it is being sent and/or is not an employee or the responsible agent for this information, this person is herein notified that any unauthorized dissemination, distribution or copying of the materials included in this facsimile is strictly prohibited. If you received this document by mistake please notify immediately to the subscriber and destroy the message. Any opinions contained in this e-mail are those of the author of the message and do not necessarily coincide with those of Radiomovil Dipsa, S.A. de C.V. or any of its control, controlled, affiliates and subsidiaries companies. No part of this message or attachments may be used or reproduced in any manner whatsoever. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] mysqldump via php
why no use phpmyadmin to admin the db? Bastien From: Jeffrey <[EMAIL PROTECTED]> To: PHP DB Subject: [PHP-DB] mysqldump via php Date: Thu, 29 Jun 2006 12:38:51 +0200 I would like to do a backup of an entire MySQL database via php. My thought was to use mysqldump, write the data to a file and save the file. However... $query="mysqldump $dbase"; $result=mysql_query($query) or die(mysql_error()); ...immediately results in an "error in your SQL syntax near mysqldump [database name]". The reason I want to do a MySQL back up via php is that I have a web application in which the user can archive a project, which involves moving a lot data from one set of tables to another set of tables. The user can also delete a project, which removes lots of data from the DB altogether. Although there are lots of "Are you sure you really want to do this?" messages the user must click upon, I am sure I will eventually get a user telling me she accidentally archived/deleted stuff and can I help. So, my thought was to do a incorporate a mysqldump in the archiving/delete page. That way there would be a snapshot of the pre-action db, making it easy to put things right. Can you help with my query - or by suggesting an alternative solution? Thanks, Jeffrey -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysqldump via php
mysqldump is a .exe, and therefore it will not work within mysql_query(); You may be able to use mysqldump from PHP using the system function check out http://uk.php.net/system Ade Jeffrey wrote: I would like to do a backup of an entire MySQL database via php. My thought was to use mysqldump, write the data to a file and save the file. However... $query="mysqldump $dbase"; $result=mysql_query($query) or die(mysql_error()); ...immediately results in an "error in your SQL syntax near mysqldump [database name]". The reason I want to do a MySQL back up via php is that I have a web application in which the user can archive a project, which involves moving a lot data from one set of tables to another set of tables. The user can also delete a project, which removes lots of data from the DB altogether. Although there are lots of "Are you sure you really want to do this?" messages the user must click upon, I am sure I will eventually get a user telling me she accidentally archived/deleted stuff and can I help. So, my thought was to do a incorporate a mysqldump in the archiving/delete page. That way there would be a snapshot of the pre-action db, making it easy to put things right. Can you help with my query - or by suggesting an alternative solution? Thanks, Jeffrey -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] mysqldump via php
I would like to do a backup of an entire MySQL database via php. My thought was to use mysqldump, write the data to a file and save the file. However... $query="mysqldump $dbase"; $result=mysql_query($query) or die(mysql_error()); ...immediately results in an "error in your SQL syntax near mysqldump [database name]". The reason I want to do a MySQL back up via php is that I have a web application in which the user can archive a project, which involves moving a lot data from one set of tables to another set of tables. The user can also delete a project, which removes lots of data from the DB altogether. Although there are lots of "Are you sure you really want to do this?" messages the user must click upon, I am sure I will eventually get a user telling me she accidentally archived/deleted stuff and can I help. So, my thought was to do a incorporate a mysqldump in the archiving/delete page. That way there would be a snapshot of the pre-action db, making it easy to put things right. Can you help with my query - or by suggesting an alternative solution? Thanks, Jeffrey -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysqldump but exclude one table. .. .
[EMAIL PROTECTED] wrote: C:\>mysqldump --version mysqldump Ver 9.09 Distrib 4.0.16, for Win95/Win98 (i32) [snip] Ummm. What version are you using, Martin? David fairly fresh I'm afraid. mysqldump Ver 10.9 Distrib 4.1.9, for pc-linux-gnu (i686) your grep generates... interesting... output :) Useful, but I hope its not default. A quick search on mysql's site isn't giving any indication when this was added - though there is mention of some replication flags with ignore-tables in 4.0.15 - since you're 4.0.16 I'm guessing that's not when it was added. Your other options are to expressly state the tables you want dumped mysqldump [OPTIONS] database [tables] the old fashioned way. You can get listings of the database through php and just have an `ignore` array that skips them when building the dump command. cheers, -- - Martin Norland, Sys Admin / Database / Web Developer, International Outreach x3257 The opinion(s) contained within this email do not necessarily represent those of St. Jude Children's Research Hospital. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysqldump but exclude one table. .
C:\>mysqldump --version mysqldump Ver 9.09 Distrib 4.0.16, for Win95/Win98 (i32) C:\>mysqldump --help | grep table STDIN 6 Dumping definition and data mysql database or table STDIN 7 Usage: mysqldump [OPTIONS] database [tables] STDIN 22--add-drop-tableAdd a 'drop table' before each create. STDIN 31In this case no tables are given. All name arguments are STDIN 41-K, --disable-keys '/*!4 ALTER TABLE tb_name DISABLE KEYS */; and STDIN 42'/*!4 ALTER TABLE tb_name ENABLE KEYS */; will be put STDIN 54-x, --first-slave Locks all tables across all databases. STDIN 61-l, --lock-tables Lock all tables for read. STDIN 65--no-autocommit Wrap tables with autocommit/commit statements. STDIN 67Dump all tables in single transaction to get consistent STDIN 68snapshot. Mutually exclusive with --lock-tables. STDIN 74Don't write table creation info. STDIN 80--opt Same as --add-drop-table --add-locks --all --quick STDIN 81--extended-insert --lock-tables --disable-keys STDIN 88-Q, --quote-names Quote table and column names with a ` STDIN 94-T, --tab=name Creates tab separated textfile for each table to given STDIN 98--tablesOverrides option --databases (-B). STDIN 112 add-drop-tableFALSE STDIN 132 lock-tables FALSE C:\>mysqldump --help | grep ignore nada. Ummm. What version are you using, Martin? David
Re: [PHP-DB] mysqldump but exclude one table. .
Hassan wrote: Hello everyone, I've a reader for sometime now, the best db list ever got into. Well, I'd like to mysqldump a certain database, but with skipping one table, is it possible? [snip] from "mysqldump --help" --ignore-table=name Do not dump the specified table. To specify more than one table to ignore, use the directive multiple times, once for each table. Each table must be specified with both database and table names, e.g. --ignore-table=database.table forgotten, but found using "mysqldump --help | grep table" and some quick scanning - docs are your friend :) cheers, -- - Martin Norland, Sys Admin / Database / Web Developer, International Outreach x3257 The opinion(s) contained within this email do not necessarily represent those of St. Jude Children's Research Hospital. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] mysqldump but exclude one table
Hello everyone, I've a reader for sometime now, the best db list ever got into. Well, I'd like to mysqldump a certain database, but with skipping one table, is it possible? Thanx - Yahoo! Mail Stay connected, organized, and protected. Take the tour
Re: [PHP-DB] mysqldump and OS X
On 10 May 2005, at 07:24, Constantin Brinzoi wrote: maybe you have to specify the full path to mysqldump like: passthru("/path/to/mysqldump --opt -h$dbhost -u$dbuser -p$dbpass $dbname It was worth a try - but no, changing the exec line to: exec("/usr/local/mysql-standard-4.1.7-apple-darwin7.5.0-powerpc/bin/ mysqldump --opt -h$dbhost -u$dbuser -p$dbpass $dbname >$filename"); Doesn't seem to make any difference :-( Thanks anyway. R
[PHP-DB] mysqldump and OS X
Wonder if anyone out there can help? I'm trying to execute a mysql dump on my local Mac (running 10.4), and I'm running into an odd problem, possibly something to do with permissions or $PATH setup. Here's the code... $dbhost = 'localhost'; $dbuser = 'user'; $dbpass = 'blah'; $dbname = 'property_rental'; $filepath = $HTTP_SERVER_VARS['DOCUMENT_ROOT']; $filename = "$filepath/data.sql"; passthru("mysqldump --opt -h$dbhost -u$dbuser -p$dbpass $dbname > $filename"); ?> Now, if I execute this on the remote server, with the correct login details, it all works tickety-boo. If I execute it locally on my Mac using the built-in Apache server and a localhost address. But if I change the passthru call to an echo, and then copy and past the result into the terminal app, it works. What am I doing wrong? Any ideas greatfully received. R -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysqldump
Hi, Look at this page and you will get all the answers http://www.geeklog.net/samplecode/backup-database regards vimal.v([EMAIL PROTECTED]) David Orlovich wrote: also ... I notice you have a space after the "-u" - should that be there? David. On 10/11/2004, at 6:59 AM, Aaron Todd wrote: I have created a PHP script that looks like: $filename'); ?> For some reason this doesnt work and I cant figure out why. There is no error that comes back. When I run the mysqldump command from the server console it produces the file fine. I have read a few other posts out there about this same thing which resulted in the location the file was being saved. But I have gone through my server and found nothing. Does anyone have any suggestions for regarding this. Thanks, Aaron -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysqldump
On Tuesday 09 November 2004 19:12, Aaron Todd wrote: Please do not top post (google > top post). > I tried the double quotes but that didn't seem to matter. It does matter. > I also put the > command string in a variable and then am running the variable with exec. > Still it doesnt work. Splitting it up into 2 steps is to aid in debugging. > $filename = "/home/virtual/site341/fst/var/www/html/db_backup_" . > date("n-j-y").".sql"; > $command = "/home/virtual/site341/fst/usr/bin/mysqldump -u * -p* > database > $filename"; > echo $command; If what is being echoed looks OK then > exec($command); make use of the extra arguments to exec() (see manual) so that you can see what's being output. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db -- /* If you can survive death, you can probably survive anything. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysqldump
Jason, I tried the double quotes but that didn't seem to matter. I also put the command string in a variable and then am running the variable with exec. Still it doesnt work. $filename = "/home/virtual/site341/fst/var/www/html/db_backup_" . date("n-j-y").".sql"; $command = "/home/virtual/site341/fst/usr/bin/mysqldump -u * -p* database > $filename"; echo $command; exec($command); Thanks for your post, Aaron "Jason Wong" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tuesday 09 November 2004 17:59, Aaron Todd wrote: >> I have created a PHP script that looks like: >> >> > $filename = "/var/www/html/db_backup_" . date("n-j-y").".sql"; >> exec('mysqldump -u * -p* database > $filename'); >> ?> >> >> For some reason this doesnt work and I cant figure out why. There is no >> error that comes back. When I run the mysqldump command from the server >> console it produces the file fine. I have read a few other posts out >> there >> about this same thing which resulted in the location the file was being >> saved. But I have gone through my server and found nothing. Does anyone >> have any suggestions for regarding this. > > Try using double quotes. > > Also just like performing SQL queries, it's a very good idea to build up > the > command you want executed, store it in a string ($cmd), then echo it to > see > whether it looks good, then exec($cmd). > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > -- > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-db > -- > /* > Save the bales! > */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysqldump
On Tuesday 09 November 2004 17:59, Aaron Todd wrote: > I have created a PHP script that looks like: > >$filename = "/var/www/html/db_backup_" . date("n-j-y").".sql"; > exec('mysqldump -u * -p* database > $filename'); > ?> > > For some reason this doesnt work and I cant figure out why. There is no > error that comes back. When I run the mysqldump command from the server > console it produces the file fine. I have read a few other posts out there > about this same thing which resulted in the location the file was being > saved. But I have gone through my server and found nothing. Does anyone > have any suggestions for regarding this. Try using double quotes. Also just like performing SQL queries, it's a very good idea to build up the command you want executed, store it in a string ($cmd), then echo it to see whether it looks good, then exec($cmd). -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-db -- /* Save the bales! */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] mysqldump
Does that user have permissions to run the mysql dump ? Bastien From: "Aaron Todd" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: [PHP-DB] mysqldump Date: Tue, 9 Nov 2004 12:59:31 -0500 I have created a PHP script that looks like: $filename'); ?> For some reason this doesnt work and I cant figure out why. There is no error that comes back. When I run the mysqldump command from the server console it produces the file fine. I have read a few other posts out there about this same thing which resulted in the location the file was being saved. But I have gone through my server and found nothing. Does anyone have any suggestions for regarding this. Thanks, Aaron -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysqldump
As far as I know...yes. Thats what I have seen on every post I have looked at and also, thats the way it worked from the console. It wouldnt work with no space. Thanks for your reply, Aaron "David Orlovich" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > also ... I notice you have a space after the "-u" - should that be there? > David. > > On 10/11/2004, at 6:59 AM, Aaron Todd wrote: > >> I have created a PHP script that looks like: >> >> > $filename = "/var/www/html/db_backup_" . date("n-j-y").".sql"; >> exec('mysqldump -u * -p* database > $filename'); >> ?> >> >> For some reason this doesnt work and I cant figure out why. There is no >> error that comes back. When I run the mysqldump command from the server >> console it produces the file fine. I have read a few other posts out >> there >> about this same thing which resulted in the location the file was being >> saved. But I have gone through my server and found nothing. Does anyone >> have any suggestions for regarding this. >> >> Thanks, >> >> Aaron >> >> -- >> PHP Database Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysqldump
also ... I notice you have a space after the "-u" - should that be there? David. On 10/11/2004, at 6:59 AM, Aaron Todd wrote: I have created a PHP script that looks like: $filename'); ?> For some reason this doesnt work and I cant figure out why. There is no error that comes back. When I run the mysqldump command from the server console it produces the file fine. I have read a few other posts out there about this same thing which resulted in the location the file was being saved. But I have gone through my server and found nothing. Does anyone have any suggestions for regarding this. Thanks, Aaron -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysqldump
I wonder if you need to specify the full pathname for mysqldump - when it's being executed by a script it may not know where mysqldump is, whereas if you execute it yourself your PATH tells it where to go, which might be why it works under that circumstance. HTH, David. On 10/11/2004, at 6:59 AM, Aaron Todd wrote: I have created a PHP script that looks like: $filename'); ?> For some reason this doesnt work and I cant figure out why. There is no error that comes back. When I run the mysqldump command from the server console it produces the file fine. I have read a few other posts out there about this same thing which resulted in the location the file was being saved. But I have gone through my server and found nothing. Does anyone have any suggestions for regarding this. Thanks, Aaron -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] mysqldump
I have created a PHP script that looks like: $filename'); ?> For some reason this doesnt work and I cant figure out why. There is no error that comes back. When I run the mysqldump command from the server console it produces the file fine. I have read a few other posts out there about this same thing which resulted in the location the file was being saved. But I have gone through my server and found nothing. Does anyone have any suggestions for regarding this. Thanks, Aaron -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysqldump
Hi buttoz Here's how I did it ... function get_script($dbname) { $cmd = "/usr/bin/mysqldump -u"._DBUSER." -p"._DBPASS." "._MDFLAGS." ".$dbname; $script = `$cmd`; return $script; } _MDFLAGS is a constant which holds the flags you want to pass to mysqldump ... I commonly use -c and -add-drop-table. _DBUSER and _DBPASS are also constants containing the username and password mysqldump needs to connect to mysql with (funnily enough!!). Note there is NO space between the -p flag and the password. HTH Ronan e: [EMAIL PROTECTED] t: 01903 739 997 w: www.thelittledot.com The Little Dot is a partnership of Ronan Chilvers and Giles Webberley On 31 May,2003 at 12:51 buttoz buttoz wrote: > hi, > > i want to backup mysql database. > i use mysqldump command . > when i use this command from server (win2000) , command promt its work fine. > but when run this command (mysqldump) from php file, it creat backup file > but > with zero size. > > what can i do , help me? > > thanks, > zuhear > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysqldump
Hi, Can you show the code? How r u running mysqldump in your php code? I think phpmyadmin has such facility as well, you may want to check their code and see how they did it ... Gurhan On Sat, 2003-05-31 at 06:51, buttoz wrote: > hi, > > i want to backup mysql database. > i use mysqldump command . > when i use this command from server (win2000) , command promt its work fine. > but when run this command (mysqldump) from php file, it creat backup file > but > with zero size. > > what can i do , help me? > > thanks, > zuhear > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] mysqldump
hi, i want to backup mysql database. i use mysqldump command . when i use this command from server (win2000) , command promt its work fine. but when run this command (mysqldump) from php file, it creat backup file but with zero size. what can i do , help me? thanks, zuhear -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php