Table of Contents Chapter 4 MySQL Programs 4.1 Overview of MySQL Programs .................................................................................................. 338 4.2 Using MySQL Programs ........................................................................................................... 342 4.2.1 Invoking MySQL Programs ............................................................................................. 342 4.2.2 Specifying Program Options ........................................................................................... 343 4.2.3 Command Options for Connecting to the Server .............................................................. 356 4.2.4 Connecting to the MySQL Server Using Command Options ............................................. 364 4.2.5 Connecting to the Server Using URI-Like Strings or Key-Value Pairs ................................ 367 4.2.6 Connecting to the Server Using DNS SRV Records ......................................................... 374 4.2.7 Connection Transport Protocols ...................................................................................... 375 4.2.8 Connection Compression Control .................................................................................... 377 4.2.9 Setting Environment Variables ........................................................................................ 381 4.3 Server and Server-Startup Programs ......................................................................................... 382 4.3.1 mysqld — The MySQL Server ........................................................................................ 382 4.3.2 mysqld_safe — MySQL Server Startup Script ................................................................. 382 4.3.3 mysql.server — MySQL Server Startup Script ................................................................. 388 4.3.4 mysqld_multi — Manage Multiple MySQL Servers ........................................................... 391 4.4 Installation-Related Programs .................................................................................................... 395 4.4.1 comp_err — Compile MySQL Error Message File ............................................................ 395 4.4.2 mysql_secure_installation — Improve MySQL Installation Security .................................... 396 4.4.3 mysql_ssl_rsa_setup — Create SSL/RSA Files ............................................................... 400 4.4.4 mysql_tzinfo_to_sql — Load the Time Zone Tables ......................................................... 403 4.4.5 mysql_upgrade — Check and Upgrade MySQL Tables .................................................... 404 4.5 Client Programs ........................................................................................................................ 414 4.5.1 mysql — The MySQL Command-Line Client ................................................................... 414 4.5.2 mysqladmin — A MySQL Server Administration Program ................................................. 448 4.5.3 mysqlcheck — A Table Maintenance Program ................................................................. 461 4.5.4 mysqldump — A Database Backup Program ................................................................... 472 4.5.5 mysqlimport — A Data Import Program ........................................................................... 501 4.5.6 mysqlpump — A Database Backup Program ................................................................... 511 4.5.7 mysqlshow — Display Database, Table, and Column Information ..................................... 531 4.5.8 mysqlslap — A Load Emulation Client ............................................................................ 539 4.6 Administrative and Utility Programs ........................................................................................... 552 4.6.1 ibd2sdi — InnoDB Tablespace SDI Extraction Utility ........................................................ 552 4.6.2 innochecksum — Offline InnoDB File Checksum Utility .................................................... 555 4.6.3 myisam_ftdump — Display Full-Text Index information ..................................................... 560 4.6.4 myisamchk — MyISAM Table-Maintenance Utility ............................................................ 561 4.6.5 myisamlog — Display MyISAM Log File Contents ............................................................ 579 4.6.6 myisampack — Generate Compressed, Read-Only MyISAM Tables ................................. 580 4.6.7 mysql_config_editor — MySQL Configuration Utility ......................................................... 586 4.6.8 mysql_migrate_keyring — Keyring Key Migration Utility ................................................... 592 4.6.9 mysqlbinlog — Utility for Processing Binary Log Files ...................................................... 598 4.6.10 mysqldumpslow — Summarize Slow Query Log Files .................................................... 625 4.7 Program Development Utilities .................................................................................................. 627 4.7.1 mysql_config — Display Options for Compiling Clients ..................................................... 627 4.7.2 my_print_defaults — Display Options from Option Files ................................................... 629 4.8 Miscellaneous Programs ........................................................................................................... 630 4.8.1 lz4_decompress — Decompress mysqlpump LZ4-Compressed Output ............................. 630 4.8.2 perror — Display MySQL Error Message Information ....................................................... 630 337