-K, --disable-keys 
/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and /*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output. This will make loading the data into a MySQL 4.0 server faster as the indexes are created after all data are inserted. 
-n, --no-create-db 
CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name; will not be put in the output. The above line will be added otherwise, if a --databases or --all-databases option was given. 
-t, --no-create-info 
Don't write table creation information (the CREATE TABLE statement). 
-d, --no-data 
Don't write any row information for the table. This is very useful if you just want to get a dump of the structure for a table! 
--opt 
Same as --quick --add-drop-table --add-locks --extended-insert --lock-tables. Should give you the fastest possible dump for reading into a MySQL server. 
-pyour_pass, --password[=your_pass] 
The password to use when connecting to the server. If you specify no `=your_pass' part, mysqldump you will be prompted for a password. 
-P, --port=... 
Port number to use for TCP/IP connections. 
--protocol=(TCP | SOCKET | PIPE | MEMORY) 
To specify the connect protocol to use. New in MySQL 4.1. 
-q, --quick 
Don't buffer query, dump directly to stdout. Uses mysql_use_result() to do this. 
-Q, --quote-names 
Quote table and column names within ``' characters. 
-r, --result-file=... 
Direct output to a given file. This option should be used in MSDOS, because it prevents new line `\n' from being converted to `\n\r' (new line + carriage return). 
--single-transaction 
This option issues a BEGIN SQL command before dumping data from server. It is mostly useful with InnoDB tables and READ_COMMITTED transaction isolation level, as in this mode it will dump the consistent state of the database at the time then BEGIN was issued without blocking any applications. When using this option you should keep in mind that only transactional tables will be dumped in a consistent state, for example, any MyISAM or HEAP tables dumped while using this option may still change state. The --single-transaction option was added in version 4.0.2. This option is mutually exclusive with the --lock-tables option as LOCK TABLES already commits a previous transaction internally. 
-S /path/to/socket, --socket=/path/to/socket 
The socket file to use when connecting to localhost (which is the default host). 
--tables 
Overrides option --databases (-B). 
-T, --tab=path-to-some-directory 
Creates a table_name.sql file, that contains the SQL CREATE commands, and a table_name.txt file, that contains the data, for each give table. The format of the `.txt' file is made according to the --fields-xxx and --lines--xxx options. Note: This option only works if mysqldump is run on the same machine as the mysqld daemon, and the user/group that mysqld is running as (normally user mysql, group mysql) needs to have permission to create/write a file at the location you specify. 
-u user_name, --user=user_name 
The MySQL user name to use when connecting to the server. The default value is your Unix login name. 
-O var=option, --set-variable var=option 
Set the value of a variable. The possible variables are listed below. Please note that --set-variable is deprecated since MySQL 4.0, just use --var=option on its own. 
-v, --verbose 
Verbose mode. Print out more information on what the program does. 
-V, --version 
Print version information and exit. 
-w, --where='where-condition' 
Dump only selected records. Note that quotes are mandatory: 
"--where=user='jimf'" "-wuserid>1" "-wuserid<1"
-X, --xml 
Dumps a database as well formed XML 
-x, --first-slave 
Locks all tables across all databases. 
--master-data 
Like --first-slave, but also prints some CHANGE MASTER TO commands which will later make your slave start from the right position in the master's binlogs, if you have set up your slave using this SQL dump of the master. 
-O net_buffer_length=#, where # < 16M 
When creating multi-row-insert statements (as with option --extended-insert or --opt), mysqldump will create rows up to net_buffer_length length. If you increase this variable, you should also ensure that the max_allowed_packet variable in the MySQL server is bigger than the net_buffer_length. 
The most normal use of mysqldump is probably for making a backup of whole databases. See section 4.4.1 Database Backups. mysqldump --opt database > backup-file.sql
You can read this back into MySQL with: mysql database < backup-file.sql
or mysql -e "source /patch-to-backup/backup-file.sql" database
However, it's also very useful to populate another MySQL server with information from a database: mysqldump --opt database | mysql --host=remote-host -C database
It is possible to dump several databases with one command: mysqldump --databases database1 [database2 ...] > my_databases.sql
If all the databases are wanted, one can use: mysqldump --all-databases > all_databases.sql

解决方案 »

  1.   

    我只想知道,怎么用mysqlimport,上面的哥们能给回答一下吗??
    如,我的建库脚本为jkjb.sql ,mysql的root的密码是123,我这样写对吗?
    mysqlimport -u root -p123 databasename < jkjb.sql;
    希望能给点提示,多谢楼主了!!
      

  2.   

    導入可以直接用 mysql 指令就可以了,如C:\mysql\bin mysql -uroot -p123 dbname < jkjb.sql;Gook Luck!