You might want to also add aliases to your shell's resource file to
You might want to also add aliases to your shell's resource file to
access @code{mysql} and @code{mysqladmin} from the command line:
access @code{mysql} and @code{mysqladmin} from the command line:
...
@@ -8196,8 +8225,8 @@ which protocol is used:
...
@@ -8196,8 +8225,8 @@ which protocol is used:
@end multitable
@end multitable
You can force a @strong{MySQL} client to use named pipes by specifying the
You can force a @strong{MySQL} client to use named pipes by specifying the
@code{--pipe} option. Use the @code{--socket} option to specify the name of
@code{--pipe} option or by specifying @code{.} as the host name.
the pipe.
Use the @code{--socket} option to specify the name of the pipe.
You can test whether or not @strong{MySQL} is working by executing the
You can test whether or not @strong{MySQL} is working by executing the
following commands:
following commands:
...
@@ -9344,7 +9373,9 @@ Don't flush key buffers between writes for any @code{MyISAM} table.
...
@@ -9344,7 +9373,9 @@ Don't flush key buffers between writes for any @code{MyISAM} table.
Enable system locking.
Enable system locking.
@item -T, --exit-info
@item -T, --exit-info
Print some debug info at exit.
This is a bit mask of different flags one can use for debugging the
mysqld server; One should not use this option if one doesn't know
exactly what it does!
@item --flush
@item --flush
Flush all changes to disk after each SQL command. Normally @strong{MySQL}
Flush all changes to disk after each SQL command. Normally @strong{MySQL}
...
@@ -18443,7 +18474,7 @@ BACKUP TABLE tbl_name[,tbl_name...] TO '/path/to/backup/directory'
...
@@ -18443,7 +18474,7 @@ BACKUP TABLE tbl_name[,tbl_name...] TO '/path/to/backup/directory'
Make a copy of all the table files to the backup directory that are the
Make a copy of all the table files to the backup directory that are the
minimum needed to restore it. Currenlty only works for @code{MyISAM}
minimum needed to restore it. Currenlty only works for @code{MyISAM}
tables. For @code{MyISAM} table, copies @code{.frm} (definition) and
tables. For @code{MyISAM} table, copies @code{.frm} (definition) and
@code{.MYD} (data) files. The index file can be rebuilt from those two.
@code{.MYD} (data) files. The index file can be rebuilt from those two.
During the backup, read lock will be held for each table, one at time,
During the backup, read lock will be held for each table, one at time,
as they are being backed up. If you want to backup several tables as
as they are being backed up. If you want to backup several tables as
...
@@ -20167,8 +20198,8 @@ The status variables listed above have the following meaning:
...
@@ -20167,8 +20198,8 @@ The status variables listed above have the following meaning:
@multitable @columnfractions .35 .65
@multitable @columnfractions .35 .65
@item @strong{Variable} @tab @strong{Meaning}
@item @strong{Variable} @tab @strong{Meaning}
@item @code{Aborted_clients} @tab Number of connections aborted because the client died without closing the connection properly.
@item @code{Aborted_clients} @tab Number of connections aborted because the client died without closing the connection properly. @xref{Communication errors}.
@item @code{Aborted_connects} @tab Number of tries to connect to the @strong{MySQL} server that failed.
@item @code{Aborted_connects} @tab Number of tries to connect to the @strong{MySQL} server that failed. @xref{Communication errors}.
@item @code{Bytes_received} @tab Number of bytes received from all clients.
@item @code{Bytes_received} @tab Number of bytes received from all clients.
@item @code{Bytes_sent} @tab Number of bytes sent to all clients.
@item @code{Bytes_sent} @tab Number of bytes sent to all clients.
@item @code{Connections} @tab Number of connection attempts to the @strong{MySQL} server.
@item @code{Connections} @tab Number of connection attempts to the @strong{MySQL} server.
...
@@ -20244,12 +20275,6 @@ If @code{Handler_read_rnd} is big, then you probably have a lot of
...
@@ -20244,12 +20275,6 @@ If @code{Handler_read_rnd} is big, then you probably have a lot of
queries that require @strong{MySQL} to scan whole tables or you have
queries that require @strong{MySQL} to scan whole tables or you have
joins that don't use keys properly.
joins that don't use keys properly.
@item
@item
If @code{Created_tmp_tables} or @code{Sort_merge_passes} are high then
your @code{mysqld} @code{sort_buffer} variables is probably too small.
@item
@code{Created_tmp_files} doesn't count the files needed to handle temporary
tables.
@item
If @code{Threads_created} is big, you may want to increase the
If @code{Threads_created} is big, you may want to increase the
@code{thread_cache_size} variable.
@code{thread_cache_size} variable.
@end itemize
@end itemize
...
@@ -20274,6 +20299,7 @@ differ somewhat:
...
@@ -20274,6 +20299,7 @@ differ somewhat:
| back_log | 50 |
| back_log | 50 |
| basedir | /my/monty/ |
| basedir | /my/monty/ |
| bdb_cache_size | 16777216 |
| bdb_cache_size | 16777216 |
| bdb_log_buffer_size | 32768 |
| bdb_home | /my/monty/data/ |
| bdb_home | /my/monty/data/ |
| bdb_max_lock | 10000 |
| bdb_max_lock | 10000 |
| bdb_logdir | |
| bdb_logdir | |
...
@@ -20381,6 +20407,12 @@ The value of the @code{--basedir} option.
...
@@ -20381,6 +20407,12 @@ The value of the @code{--basedir} option.
@item @code{bdb_cache_size}
@item @code{bdb_cache_size}
The buffer that is allocated to cache index and rows for @code{BDB}
The buffer that is allocated to cache index and rows for @code{BDB}
tables. If you don't use @code{BDB} tables, you should start
@code{mysqld} with @code{--skip-bdb} to not waste memory for this
cache.
@item @code{bdb_log_buffer_size}
The buffer that is allocated to cache index and rows for @code{BDB}
tables. If you don't use @code{BDB} tables, you should set this to 0 or
tables. If you don't use @code{BDB} tables, you should set this to 0 or
start @code{mysqld} with @code{--skip-bdb} to not waste memory for this
start @code{mysqld} with @code{--skip-bdb} to not waste memory for this
cache.
cache.
...
@@ -20552,7 +20584,13 @@ will be incremented. If you are using @code{--log-slow-queries}, the query
...
@@ -20552,7 +20584,13 @@ will be incremented. If you are using @code{--log-slow-queries}, the query
will be logged to the slow query logfile. @xref{Slow query log}.
will be logged to the slow query logfile. @xref{Slow query log}.
@item @code{lower_case_table_names}
@item @code{lower_case_table_names}
Table names are stored in lowercase on disk.
Is 1 if table names are stored in lowercase on disk. On @strong{MySQL} on Unix
tables are always case-sensitive; Is this a big problem for you can
start @code{mysqld} with @code{-O lower_case_table_names=1}
In this case @strong{MySQL} will convert all table names to lower case on
storage and lookup. Not that you need to first convert your old table
names to lower case before starting @code{mysqld} with this option.
@item @code{max_allowed_packet}
@item @code{max_allowed_packet}
The maximum size of one packet. The message buffer is initialized to
The maximum size of one packet. The message buffer is initialized to
...
@@ -21289,7 +21327,7 @@ When you use @code{LOCK TABLES}, you must lock all tables that you are
...
@@ -21289,7 +21327,7 @@ When you use @code{LOCK TABLES}, you must lock all tables that you are
going to use and you must use the same alias that you are going to use
going to use and you must use the same alias that you are going to use
in your queries! If you are using a table multiple times in a query
in your queries! If you are using a table multiple times in a query
(with aliases), you must get a lock for each alias! This policy ensures
(with aliases), you must get a lock for each alias! This policy ensures
that table locking is deadlock free andh makes the locking code smaller,
that table locking is deadlock free and makes the locking code smaller,
simpler and much faster.
simpler and much faster.
Note that you should @strong{NOT} lock any tables that you are using with
Note that you should @strong{NOT} lock any tables that you are using with
...
@@ -22678,10 +22716,10 @@ Berkeley DB (@uref{http://www.sleepycat.com}) has provided
...
@@ -22678,10 +22716,10 @@ Berkeley DB (@uref{http://www.sleepycat.com}) has provided
crashes and also provides @code{COMMIT} and @code{ROLLBACK} on
crashes and also provides @code{COMMIT} and @code{ROLLBACK} on
transactions. In order to build MySQL Version 3.23.x (BDB support first
transactions. In order to build MySQL Version 3.23.x (BDB support first
appeared in Version 3.23.15) with support for @code{BDB} tables, you
appeared in Version 3.23.15) with support for @code{BDB} tables, you
will need Berkeley DB Version 3.2.3d or newer which can be downloaded from
will need Berkeley DB Version 3.2.3g or newer which can be downloaded from
@uref{http://www.mysql.com/downloads/mysql-3.23.html}. This is a patched
@uref{http://www.mysql.com/downloads/mysql-3.23.html}. This is a patched
version of Berkeley DB that is only available from @strong{MySQL}; the
version of Berkeley DB that is only available from @strong{MySQL}; the
standard Berkeley DB @strong{will not work with MySQL}.
standard Berkeley DB @strong{will not yet work with MySQL}.
@node BDB install, BDB start, BDB overview, BDB
@node BDB install, BDB start, BDB overview, BDB
@subsection Installing BDB
@subsection Installing BDB
...
@@ -22851,6 +22889,11 @@ TABLE}.
...
@@ -22851,6 +22889,11 @@ TABLE}.
@itemize @bullet
@itemize @bullet
@item
@item
It's very slow to open many BDB tables at the same time. If you are
going to use BDB tables, you should not have a very big table cache (>
256 ?) and you should use @code{--no-auto-rehash} with the @code{mysql}
client. We plan to partly fix this in 4.0.
@item
@code{SHOW TABLE STATUS} doesn't yet provide that much information for BDB
@code{SHOW TABLE STATUS} doesn't yet provide that much information for BDB
tables.
tables.
@item
@item
...
@@ -28310,6 +28353,7 @@ How big a @code{VARCHAR} column can be
...
@@ -28310,6 +28353,7 @@ How big a @code{VARCHAR} column can be
* mysql:: The command line tool
* mysql:: The command line tool
* mysqladmin:: Administering a @strong{MySQL} server
* mysqladmin:: Administering a @strong{MySQL} server
* mysqldump:: Dumping the structure and data from @strong{MySQL} databases and tables
* mysqldump:: Dumping the structure and data from @strong{MySQL} databases and tables
* mysqlhotcopy:: Copying @strong{MySQL} Databases and Tables
* mysqlimport:: Importing data from text files
* mysqlimport:: Importing data from text files
* perror:: Displaying error messages
* perror:: Displaying error messages
* mysqlshow:: Showing databases, tables and columns
* mysqlshow:: Showing databases, tables and columns
...
@@ -29167,17 +29211,22 @@ If you do @code{myslqadmin shutdown} on a socket (in other words, on a
...
@@ -29167,17 +29211,22 @@ If you do @code{myslqadmin shutdown} on a socket (in other words, on a
the computer where @code{mysqld} is running), @code{mysqladmin} will
the computer where @code{mysqld} is running), @code{mysqladmin} will
wait until the @strong{MySQL} @code{pid-file} is removed to ensure that
wait until the @strong{MySQL} @code{pid-file} is removed to ensure that
the @code{mysqld} server has stopped properly.
the @code{mysqld} server has stopped properly.
@cindex dumping, databases
@cindex dumping, databases
@cindex databases, dumping
@cindex databases, dumping
@cindex tables, dumping
@cindex tables, dumping
@cindex backing up, databases
@cindex backing up, databases
@node mysqldump, mysqlimport, mysqladmin, Tools
@node mysqldump, mysqlhotcopy, mysqladmin, Tools
@section Dumping the Structure and Data from MySQL Databases and Tables
@section Dumping the Structure and Data from MySQL Databases and Tables
@cindex @code{mysqldump}
@cindex @code{mysqldump}
Utility to dump a database or a collection of database for backup or
Utility to dump a database or a collection of database for backup or for
for transferring the data to another SQL server. The dump will contain SQL
transferring the data to another SQL server (not necessarily a MySQL
statements to create the table and/or populate the table:
server). The dump will contain SQL statements to create the table
and/or populate the table.
If you are doing a backup on the server, you should consider using
the @code{mysqlhotcopy} instead. @xref{mysqlhotcopy}.
@example
@example
shell> mysqldump [OPTIONS] database [tables]
shell> mysqldump [OPTIONS] database [tables]
...
@@ -29350,12 +29399,79 @@ If all the databases are wanted, one can use:
...
@@ -29350,12 +29399,79 @@ If all the databases are wanted, one can use:
mysqldump --all-databases > all_databases.sql
mysqldump --all-databases > all_databases.sql
@end example
@end example
@cindex dumping, databases
@cindex databases, dumping
@cindex tables, dumping
@cindex backing up, databases
@node mysqlhotcopy, mysqlimport, mysqldump, Tools
@section Copying MySQL Databases and Tables
@code{mysqlhotcopy} is a perl script that uses @code{LOCK TABLES},
@code{FLUSH TABLES} and @code{cp} or @code{scp} to quickly make a backup
of a database. It's the fastest way to make a backup of the database,
but it can only be run on the same machine where the database directories