|
Home >> FAQs/Tutorials >> MySQL Tutorials >> Index
MySQL FAQs - Administrator Tools for Managing MySQL Server
By: FYIcenter.com
Part:
1
2
3
4
(Continued from previous part...)
How To Dump a Table to a File with "mysqldump"?
If you want to dump all rows in a table from the server to a file, you
can use "mysqldump" with the "-f fileName" option as show in the following tutorial
exercise:
>cd \mysql\bin
>mysqldump -u root -r \temp\links.txt test links
>type \temp\links.txt
>type \temp\links.txt | more
-- MySQL dump 10.10
--
-- Host: localhost Database: test
-- ------------------------------------------------------
-- Server version 5.0.24-community
...
The dump file contains SQL statements that you can use to restore the table
and its data content.
What Is "mysqlimport"?
"mysqlimport" - A command-line interface for administrators or end users
to load data files into tables program tool to load data into tables.
Here is a sample commands supported by "mysqlimport":
- "mysqlimport databaseName fileName" - Imports the data from the specified file
to the specified database. The data will be loaded into the table who's name matches
the specified file name.
To know about "mysqlimport", read other parts of this FAQ collection.
How To Load Data Files into Tables with "mysqlimport"?
If you want to load a data file directly into a table, you need to prepare
the data file as one line per data row, and use tab character as the column delimiter.
The data file name should match the target table name.
The following is a good tutorial exercise on using "mysqlimport":
>cd \mysql\bin
>type \temp\links.tab
dev.fyicenter.com
www.mysql.com
>mysqlimport -u root test \temp\links.tab
test.links: Records: 2 Deleted: 0 Skipped: 0 Warnings: 0
>mysql -u root -e "SELECT * FROM links" test
+-------------------+
| name |
+-------------------+
| dba.fyicenter.com |
| dev.fyicenter.com |
| www.mysql.com |
+-------------------+
Part:
1
2
3
4
|