MapPress is a WordPress plugin that provides an interface to Google Maps and easily allows you to insert detailed Google Maps into WordPress posts or pages. We have a site that provides password auditing services called QD Tools and on the homepage there is a map that lists the city, state/province, and country of our customers. I have been using MapPress Pro for a long time because it offers lots of extra features and MapPress itself is such an awesome plugin I like supporting the developer. Anyhow the Google Map on the QD Tools homepage is has over 1,000 markers and continues to grow. I wanted to modify the default MapPress/Google Maps marker that was being used but there is no way in MapPress to retroactively change this so the instructions below explain how to do this.04, 12, google, Google Maps, Linux, mappress, marker, mysql, mysqldump, PNG, sql, ubuntu, vi, WordPress, WordPress plugin
Posts Tagged “mysqldump”
Jan 16 2013
Feb 28 2011
mysqldump: Got error: 145: Table ‘./wordpress/bot_prli_clicks’ is marked as crashed and should be repaired when using LOCK TABLESPosted by alex in Errors
Earlier I was in the process of upgrading MySQL on a CentOS Linux server and ran into an error when I attempted to backup all of the MySQL databases. When issuing the mysqldump command I received an error 145 noting that one of the mysql database tables was marked as crashed and needed to be repaired. Below I have noted the error in more detail as well as how to repair any tables that are marked as crashed..frm, .MYD, .MYI, /var/lib/mysql, 145, 5.0, 5.1, CentOS, crashed, data records, database, error, fixing index, Linux, LOCK TABLES, myisamchk, mysql, mysqldump, outside data file, repaired
Aug 15 2009
WordPress mysqldump Backup Corrupted Because of Blob Fields in Angsuman’s Translator Plugin Pro MySQL TablesPosted by alex in Insights
During a recent WordPress upgrade I was performing I noticed an issue with the mysqldump of the WordPress database which was causing the actual .sql file backup of the database to not read properly. After investigating I noticed that the atpp_page_cache table from Angsuman’s Translator Plugin Pro included Blob columns that were not dumping properly with the default mysqldump syntax as shown below.
mysqldump -u root -p databasename > db_backup_file.sqlangsuman's, atpp, blob, column, corrupted, database, error, export, mysql, mysqldump, phpMyAdmin, plugin, syntax, table, translator pro, WordPress
MYSQLDUMP(1) MySQL Database System MYSQLDUMP(1)
If you are doing a backup on the server and your tables all are MyISAM tables, consider using the mysqlhotcopy instead because it can accomplish faster
There are three general ways to invoke mysqldump:
shell> mysqldump [options] db_name [tables]
If you do not name any tables following db_name or if you use the –databases or –all-databases option, entire databases are dumped.
To get a list of the options your version of mysqldump supports, execute mysqldump –help.
Some mysqldump options are shorthand for groups of other options. –opt and –compact fall into this category. For example, use of –opt is the same as
To reverse the effect of a group option, uses its –skip-xxx form (–skip-opt or –skip-compact). It is also possible to select only part of the effect of
? To select the effect of –opt except for some features, use the –skip option for each feature. For example, to disable extended inserts and memory
? To reverse –opt for all features except index disabling and table locking, use –skip-opt –disable-keys –lock-tables.
When you selectively enable or disable the effect of a group option, order is important because options are processed first to last. For example,
mysqldump can retrieve and dump table contents row by row, or it can retrieve the entire content from a table and buffer it in memory before dumping it.
If you are using a recent version of mysqldump to generate a dump to be reloaded into a very old MySQL server, you should not use the –opt or
Before MySQL 4.1.2, out-of-range numeric values such as -inf and inf, as well as NaN (not-a-number) values are dumped by mysqldump as NULL. You can see
mysql> CREATE TABLE t (f DOUBLE);
For this table, mysqldump produces the following data output:
The significance of this behavior is that if you dump and restore the table, the new table has contents that differ from the original contents. This
mysqldump supports the following options:
? –help, -?
Display a help message and exit.
Add a DROP DATABASE statement before each CREATE DATABASE statement.
Add a DROP TABLE statement before each CREATE TABLE statement.
Surround each table dump with LOCK TABLES and UNLOCK TABLES statements. This results in faster inserts when the dump file is reloaded. See Section 2.17,
? –all-databases, -A
Dump all tables in all databases. This is the same as using the –databases option and naming all the databases on the command line.
Allow creation of column names that are keywords. This works by prefixing each column name with the table name.
The directory where character sets are installed. See Section 8.1, “The Character Set Used for Data and Sorting”.
? –comments, -i
Write additional information in the dump file such as program version, server version, and host. This option is enabled by default. To suppress this
Produce less verbose output. This option suppresses comments and enables the –skip-add-drop-table, –skip-set-charset, –skip-disable-keys, and
Produce output that is more compatible with other database systems or with older MySQL servers. The value of name can be ansi, mysql323, mysql40,
This option does not guarantee compatibility with other servers. It only enables those SQL mode values that are currently available for making dump
This option requires a server version of 4.1.0 or higher. With older servers, it does nothing.
? –complete-insert, -c
Use complete INSERT statements that include column names.
? –compress, -C
Compress all information sent between the client and the server if both support compression.
Include all MySQL-specific table options in the CREATE TABLE statements.
? –databases, -B
Dump several databases. Normally, mysqldump treats the first name argument on the command line as a database name and following names as table names.
? –debug[=debug_options], -# [debug_options]
Write a debugging log. The debug_options string is often ?d:t:o,file_name’. The default value is ?d:t:o,/tmp/mysqldump.trace’.
Use charset_name as the default character set. See Section 8.1, “The Character Set Used for Data and Sorting”. If no character set is specified,
Write INSERT DELAYED statements rather than INSERT statements.
On a master replication server, delete the binary logs after performing the dump operation. This option automatically enables –master-data.
? –disable-keys, -K
For each table, surround the INSERT statements with /*!40000 ALTER TABLE tbl_name DISABLE KEYS */; and /*!40000 ALTER TABLE tbl_name ENABLE KEYS */;
? –extended-insert, -e
Use multiple-row INSERT syntax that include several VALUES lists. This results in a smaller dump file and speeds up inserts when the file is reloaded.
? –fields-terminated-by=…, –fields-enclosed-by=…, –fields-optionally-enclosed-by=…, –fields-escaped-by=…
These options are used with the -T option and have the same meaning as the corresponding clauses for LOAD DATA INFILE. See Section 2.5, “LOAD DATA
? –first-slave, -x
Deprecated. Now renamed to –lock-all-tables.
? –flush-logs, -F
Flush the MySQL server log files before starting the dump. This option requires the RELOAD privilege. Note that if you use this option in combination
Emit a FLUSH PRIVILEGES statement after dumping the mysql database. This option should be used any time the dump contains the mysql database and any
? –force, -f
Continue even if an SQL error occurs during a table dump.
One use for this option is to cause mysqldump to continue executing even when it encounters a view that has become invalid because the defintion refers
? –host=host_name, -h host_name
Dump data from the MySQL server on the given host. The default host is localhost.
Dump binary columns using hexadecimal notation (for example, ?abc’ becomes 0×616263). The affected data types are BINARY, VARBINARY, and BLOB. As of
Do not dump the given table, which must be specified using both the database and table names. To ignore multiple tables, use this option multiple times.
Write INSERT statements with the IGNORE option.
This option is used with the -T option and has the same meaning as the corresponding clause for LOAD DATA INFILE. See Section 2.5, “LOAD DATA INFILE
? –lock-all-tables, -x
Lock all tables across all databases. This is achieved by acquiring a global read lock for the duration of the whole dump. This option automatically
? –lock-tables, -l
Lock all tables before dumping them. The tables are locked with READ LOCAL to allow concurrent inserts in the case of MyISAM tables. For transactional
Please note that when dumping multiple databases, –lock-tables locks tables for each database separately. Therefore, this option does not guarantee
Write the binary log filename and position to the output. This option requires the RELOAD privilege and the binary log must be enabled. If the option
The –master-data option automatically turns off –lock-tables. It also turns on –lock-all-tables, unless –single-transaction also is specified (in
Enclose the INSERT statements for each dumped table within SET AUTOCOMMIT=0 and COMMIT statements.
? –no-create-db, -n
This option suppresses the CREATE DATABASE statements that are otherwise included in the output if the –databases or –all-databases option is given.
? –no-create-info, -t
Do not write CREATE TABLE statements that re-create each dumped table.
? –no-data, -d
Do not write any table row information (that is, do not dump table contents). This is very useful if you want to dump only the CREATE TABLE statement
This option is shorthand; it is the same as specifying –add-drop-table –add-locks –create-options –disable-keys –extended-insert –lock-tables
The –opt option is enabled by default. Use –skip-opt to disable it. See the discussion at the beginning of this section for information about
Sorts each table’s rows by its primary key, or by its first unique index, if such an index exists. This is useful when dumping a MyISAM table to be
? –password[=password], -p[password]
The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password.
Specifying a password on the command line should be considered insecure. See Section 6.6, “Keeping Your Password Secure”.
? –port=port_num, -P port_num
The TCP/IP port number to use for the connection.
The connection protocol to use.
? –quick, -q
This option is useful for dumping large tables. It forces mysqldump to retrieve rows for a table from the server a row at a time rather than retrieving
? –quote-names, -Q
Quote database, table, and column names within ”’ characters. If the ANSI_QUOTES SQL mode is enabled, names are quoted within ‘”‘ characters. This
? –result-file=file, -r file
Direct output to a given file. This option should be used on Windows to prevent newline ‘\n’ characters from being converted to ‘\r\n’ carriage
? –routines, -R
Dump stored routines (functions and procedures) from the dumped databases. Use of this option requires the SELECT privilege for the mysql.proc table.
If you require routines to be re-created with their original timestamp attributes, do not use –routines. Instead, dump and reload the contents of the
This option was added in MySQL 5.0.13. Before that, stored routines are not dumped. Routine DEFINER values are not dumped until MySQL 5.0.20. This means
Add SET NAMES default_character_set to the output. This option is enabled by default. To suppress the SET NAMES statement, use –skip-set-charset.
This option issues a BEGIN SQL statement before dumping data from the server. It is useful only with transactional tables such as InnoDB and BDB,
When using this option, you should keep in mind that only InnoDB tables are dumped in a consistent state. For example, any MyISAM or MEMORY tables
The –single-transaction option and the –lock-tables option are mutually exclusive, because LOCK TABLES causes any pending transactions to be committed
This option is not supported for MySQL Cluster tables; the results cannot be guaranteed to be consistent due to the fact that the NDBCluster storage
To dump large tables, you should combine this option with –quick.
See the description for the –opt option.
? –socket=path, -S path
For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use.
See the description for the –comments option.
Options that begin with –ssl specify whether to connect to the server via SSL and indicate where to find SSL keys and certificates. See Section 6.7.3,
? –tab=path, -T path
Produce tab-separated data files. For each dumped table, mysqldump creates a tbl_name.sql file that contains the CREATE TABLE statement that creates the
By default, the .txt data files are formatted using tab characters between column values and a newline at the end of each line. The format can be
Note: This option should be used only when mysqldump is run on the same machine as the mysqld server. You must have the FILE privilege, and the server
Override the –databases or -B option. mysqldump regards all name arguments following the option as table names.
Dump triggers for each dumped table. This option is enabled by default; disable it with –skip-triggers. This option was added in MySQL 5.0.11. Before
Add SET TIME_ZONE=’+00:00′ to the dump file so that TIMESTAMP columns can be dumped and reloaded between servers in different time zones. Without this
? –user=user_name, -u user_name
The MySQL username to use when connecting to the server.
? –verbose, -v
Verbose mode. Print more information about what the program does.
? –version, -V
Display version information and exit.
? –where=’where_condition’, -w ‘where_condition’
Dump only rows selected by the given WHERE condition. Quotes around the condition are mandatory if it contains spaces or other characters that are
? –xml, -X
Write dump output as well-formed XML.
NULL, ‘NULL’, and Empty Values: For some column named column_name, the NULL value, an empty string, and the string value ?NULL’ are distinguished from
Beginning with MySQL 5.0.40, XML output from mysqldump includes the XML namespace, as shown here:
shell> mysqldump –xml -u root world City
Null=”" Index_type=”BTREE” Comment=”" />
e_time=”2007-03-31 01:47:02″ Collation=”latin1_swedish_ci” Create_options=”" Comment=”" />
You can also set the following variables by using –var_name=value syntax:
The maximum size of the buffer for client/server communication. The maximum is 1GB.
The initial size of the buffer for client/server communication. When creating multiple-row-insert statements (as with option –extended-insert or
It is also possible to set variables by using –set-variable=var_name=value or -O var_name=value syntax. This syntax is deprecated.
The most common use of mysqldump is probably for making a backup of an entire database:
shell> mysqldump db_name > backup-file.sql
You can read the dump file back into the server like this:
shell> mysql db_name < backup-file.sql
Or like this:
shell> mysql -e “source /path-to-backup/backup-file.sql” db_name
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
It is possible to dump several databases with one command:
shell> mysqldump –databases db_name1 [db_name2 ...] > my_databases.sql
To dump all databases, use the –all-databases option:
shell> mysqldump –all-databases > all_databases.sql
For InnoDB tables, mysqldump provides a way of making an online backup:
shell> mysqldump –all-databases –single-transaction > all_databases.sql
This backup just needs to acquire a global read lock on all tables (using FLUSH TABLES WITH READ LOCK) at the beginning of the dump. As soon as this lock
For point-in-time recovery (also known as “roll-forward,” when you need to restore an old backup and replay the changes that happened since that backup),
shell> mysqldump –all-databases –master-data=2 > all_databases.sql
shell> mysqldump –all-databases –flush-logs –master-data=2
The –master-data and –single-transaction options can be used simultaneously, which provides a convenient way to make an online backup suitable for
For more information on making backups, see Section 7.1, “Database Backups”, and Section 7.2, “Example Backup and Recovery Strategy”.
If you encounter problems backing up views, please read the section that covers restrictions on views which describes a workaround for backing up views
This documentation is NOT distributed under a GPL license. Use of this documentation is subject to the following terms: You may create a printed copy of
Please email for more information.
MySQL 5.0 07/04/2007 MYSQLDUMP(1)Tags: all-databases, database, drop, extend, INSERT, mysql, mysqldump
Apr 15 2009
Dump MySQL database: Use the below mysqldump command syntax to dump a single database from a MySQL
mysqldump -u root -ppassword database_name > database_staging-04-14-2008.sql
Dump One Table from a MySQL DB: The below syntax will dump one MySQL table including the SQL syntax needed to drop that table if it already exists in the database you eventually restore it to.--add-drop-table, database, man, mysql, mysqldump, password, switches, username