[Mediawiki-l] mysqldump

Klaus Becker colonius at free.fr
Mon May 14 13:32:07 UTC 2007


Am Sonntag, 13. Mai 2007 22:14 schrieb Klaus Becker:
> Am Sonntag, 13. Mai 2007 21:28 schrieb Klaus Becker:
> > Am Sonntag, 13. Mai 2007 20:30 schrieb Rob Church:
> > > On 13/05/07, Klaus Becker <colonius at free.fr> wrote:
> > > > ">mysqldump wikidb > /home/klaus/backup.sql"   or
> > > > ">mysqldump wikidb > backup.sql"
> > >
> > > You might need to pass authentication information, e.g.
> > >
> > > %mysqldump -u wikiuser -p wikidb >wikidb.sql
> > >
> > > Also check the database name and server state, etc.
> > >
> > > > If I try the same command in phpmyadmin, I get:
> > >
> > > mysqldump is an application, not an SQL statement; it won't work in
> > > phpMyAdmin.
> > >
> > >
> > > Rob Church
> >
> > Hi Rob,
> >
> > finally I can dump and restore my db correctly with
> >
> > mysqldump -u root -p --default-character-set=latin1 -d wikidb
> >
> > > '/home/klaus/backup.sql'
> >
> > mysql -u root -p wikidb < '/home/klaus/wikidb.sql'
> >
> > I did this for my local db and with this method I have no more charset
> > problem ! That's what I am searching since a long time. There must be a
> > problem with phpmyadmin, because saving and restoring with phpmyadmin
> > 2.9.1.1 creates charset problems if if I indicate "MySQL connection
> > collation:" latin1_bin.
> >
> > But now the great question: how can I do the same thing with my db on the
> > web (ovh.net). Mysqldump does'nt work within phpmyadmin, so I can't
> > execute it remotely.
> >
> > The manpage says:
> > mysqldump is also very useful for populating databases by copying data
> > from one MySQL server to another:
> > shell> mysqldump --opt db_name | mysql --host=remote_host -C db_name
> >
> > Is this the right way to dump my db remotely ? If yes, can you explain
> > this command a little bit ? What is "remote_host -C" ?
> >
> > Or is there a script to do it, for example dumpBackup.php ? Can I restore
> > then with importDump.php ?
> >
> > All this is quite new for me, I always used phpmyadmin or a scrit to
> > upload my local db and I never had these problems.
> >
> > thanks
> >
> > Klaus
>
> I think a found a way to do it. OVH.com proposes a php script:
>
> <?
> system("mysqldump --host=sql_server --user=name_of_db --password=passwort
> name_of_db > name_of_db.sql");
> ?>
>
> I shall try this tomorrow with the option "--default-character-set=latin1"
>
> Klaus

So I tried: it works, the interior links are ok ! I exported the db with the 
above script and I imported it with phpmyadmin while specifying 
character-set=latin1. So my conclusion is: phpmyadmin 2.9.1.1 (on Debian 
Etch) does not export correctly (specifying character-set=latin1 does not 
work), but it imports correctly.

cheers
Klaus



More information about the MediaWiki-l mailing list