Linux commands: Difference between revisions

Jump to navigation Jump to search
m
Line 119: Line 119:
=== import MySql sql file ===
=== import MySql sql file ===
{{exclaim}} Notice: existing database will be overwritten
{{exclaim}} Notice: existing database will be overwritten
* {{Gd}} Import the compressed *.sql file with gzip (especially for BIG sql file). It will show a progress bar and estimate time to complete the mysql command:  
* {{Gd}} Import the compressed *.sql file with gzip (especially for BIG sql file). It will show a progress bar and estimated time to complete the mysql command:  
*# (optional if the {{kbd | key =pv}} was not installed) {{kbd | key =yum install pv}} for RHEL / CentOS / SL / Fedora Linux<ref>[http://www.cyberciti.biz/open-source/command-line-hacks/pv-command-examples/ Linux / Unix pv Command: Monitor Progress of Data Sent Via a Pipe]</ref>
*# (optional if the {{kbd | key =pv}} was not installed) {{kbd | key =yum install pv}} for RHEL / CentOS / SL / Fedora Linux<ref>[http://www.cyberciti.biz/open-source/command-line-hacks/pv-command-examples/ Linux / Unix pv Command: Monitor Progress of Data Sent Via a Pipe]</ref>
*# {{kbd | key =  <nowiki> pv database.sql.gz | gunzip | mysql -u username -p -h localhost DATA-BASE-NAME</nowiki>}} <ref>[http://journal.andrewloe.com/2009/05/12/pv-gzip-mysql/ pv + gzip + mysql — W. Andrew Loe III: Journal]</ref> and press {{kbd | key =  <nowiki>Enter</nowiki> }}
*# {{kbd | key =  <nowiki> pv database.sql.gz | gunzip | mysql -u username -p -h localhost DATA-BASE-NAME</nowiki>}} <ref>[http://journal.andrewloe.com/2009/05/12/pv-gzip-mysql/ pv + gzip + mysql — W. Andrew Loe III: Journal]</ref> and press {{kbd | key =  <nowiki>Enter</nowiki> }}

Navigation menu