Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/htdocs/w01136d3/wordpress/wp-content/plugins/deans_code_highlighter/geshi.php on line 2147

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/htdocs/w01136d3/wordpress/wp-content/plugins/deans_code_highlighter/geshi.php on line 2147

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/htdocs/w01136d3/wordpress/wp-content/plugins/deans_code_highlighter/geshi.php on line 2147

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/htdocs/w01136d3/wordpress/wp-content/plugins/deans_code_highlighter/geshi.php on line 2147

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/htdocs/w01136d3/wordpress/wp-content/plugins/deans_code_highlighter/geshi.php on line 2147

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/htdocs/w01136d3/wordpress/wp-content/plugins/deans_code_highlighter/geshi.php on line 2147

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/htdocs/w01136d3/wordpress/wp-content/plugins/deans_code_highlighter/geshi.php on line 2147

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/htdocs/w01136d3/wordpress/wp-content/plugins/deans_code_highlighter/geshi.php on line 2147

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/htdocs/w01136d3/wordpress/wp-content/plugins/deans_code_highlighter/geshi.php on line 2147

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/htdocs/w01136d3/wordpress/wp-content/plugins/deans_code_highlighter/geshi.php on line 2147

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/htdocs/w01136d3/wordpress/wp-content/plugins/deans_code_highlighter/geshi.php on line 2147

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/htdocs/w01136d3/wordpress/wp-content/plugins/deans_code_highlighter/geshi.php on line 2147

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/htdocs/w01136d3/wordpress/wp-content/plugins/deans_code_highlighter/geshi.php on line 2147

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/htdocs/w01136d3/wordpress/wp-content/plugins/deans_code_highlighter/geshi.php on line 2147

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/htdocs/w01136d3/wordpress/wp-content/plugins/deans_code_highlighter/geshi.php on line 2147

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/htdocs/w01136d3/wordpress/wp-content/plugins/deans_code_highlighter/geshi.php on line 2147

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/htdocs/w01136d3/wordpress/wp-content/plugins/deans_code_highlighter/geshi.php on line 2147

Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /www/htdocs/w01136d3/wordpress/wp-content/plugins/deans_code_highlighter/geshi.php on line 2147

Wer die bekannte Datenbank MySQL verwendet und die Daten sichern oder umziehen will, macht dies am besten mit dem mysqldump Befehl, welcher einem unter Linux zur Verfügung steht. Ich hatte neulich das Problem, dass ich die exportierten Daten kontrollieren musste und mir dies aus Gründen der Übersichtlcihkeit ziemlich schwer fiel. Standardmäßig exportiert mysqldump die Daten in Form von erweiterten INSERT-Befehlen, bei denen alle Werte in eine Zeile gepackt werden, um die Datenmenge klein zu halten. Für ein übersichtliches Vergleichen – Suchen und Finden bestimmter Zeilen, hätte ich jedoch gern einen separaten INSERT-Befehl je Datenzeile.

mysqldump Syntax in der Linux-Shell

mysqldump -u DBUSERNAME -p DBNAME [DBTABLENAME] > BACKUPFILENAME

mysqldump Resultat mit extended inserts

span class=“st0″>’data_row1_col1′, ‚data_row1_col2‘), (‚data_row2_col1‘, ‚data_row2_col2‘);

Die Lösung für die separaten INSERTs ist der Paramter –skip-extended-insert, welcher zwar in den Manpages von mysqldump steht, allerdings dort nur sehr schwer zu finden ist.

mysqldump mit skip-extended-insert

mysqldump –skip-extended-insert -u DBUSERNAME -p DBNAME [DBTABLENAME] > BACKUPFILENAME

mysqldump Resultat ohne extended inserts

span class=“st0″>’data_row1_col1′, ‚data_row1_col2‘‚data_row2_col1‘, ‚data_row2_col2‘);

Mehr zum mysqldump-Befehl findet man auf der mysql.com Homepage.

Mittwoch, 25. März 2009 [Linux] RSS 2.0 / Trackback senden

Noch keine Kommentare.

Einen Kommentar hinterlassen

XHTML allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>