mariadb-convert-table-format converts the tables in a database to use a particular storage engine (MyISAM by default).
mariadb-convert-table-format is written in Perl and requires that the DBI and DBD::mysql Perl modules be installed. Invoke mariadb-convert-table-format like this:
The db_name argument indicates the database containing the tables to be converted.
mariadb-convert-table-format supports the options described in the following list:
This page is licensed: CC BY-SA / Gnu FDL
-S, --socket=path
For connections to localhost, the Unix socket file to use.
-u, --user=user_name
The MariaDB user name to use when connecting to the server.
-v, --verbose
Verbose mode. Print more information about what the program does.
-V, --version
Display version information and exit.
-?, --help
Display help and exit.
-e, --engine=ENGINE
Specify the storage engine that the tables should be converted to use. The default is MyISAM if this option is not given.
-f, --force
Continue even if errors occur.
-h, --host=host_name
Connect to the MariaDB server on the given host. Default localhost.
-p, --password=password
The password to use when connecting to the server. Note that the password value is not optional for this option, unlike for other client programs. Specifying the password on the command line is generally considered insecure.
-P, --port=port_num
The TCP/IP port number to use for the connection.
mariadb-convert-table-format [options] db_nameshell> mariadb-convert-table-format [options]db_namemariadb-check is a maintenance tool that allows you to check, repair, analyze and optimize multiple tables from the command line.
It is essentially a command-line interface to the , , , and statements, and so, unlike and , requires the server to be running.
This tool does not work with partitioned tables.
OR
OR
mariadb-check can be used to CHECK (-c, -m, -C), REPAIR (-r), ANALYZE (-a), or OPTIMIZE (-o) tables. Some of the options (like -e or -q) can be used in combination.
Not all options are supported by all storage engines.
The -c, -r, -a, and -o options are exclusive to each other.
The --check option is used by default, if no other options were specified. You can change the default behavior by making a symbolic link to the binary, or copying it somewhere with another name, the alternatives are:
mariadb-check supports the following options:
In addition to reading options from the command line, mariadb-check can also read options from . If an unknown option is provided to mariadb-check in an option file, it is ignored.
The following options relate to how MariaDB command line tools handles option files. They must be given as the first argument on the command line:
mariadb-check is linked with . However, MariaDB Connector/C does not yet handle the parsing of option files for this client. That is still performed by the server option file parsing code. See for more information.
Option Groups
mariadb-check reads options from the following from :
To see the default values for the options and the arguments you get from configuration files, you can do:
When running mariadb-check with --auto-repair (as done by ), mariadb-check will first check all tables and then in a separate phase repair those that failed the check.
mariadb-check --all-databases will ignore the internal log tables and as these can't be checked, repaired or optimized.
Using one --verbose option will give you more information about what mariadb-check is doing.
Using two --verbose options will also give you connection information.
If you use three --verbose options you will also get, on stdout, all , , and commands that mariadb-check executes.
From MariaDB 12.0, mariadb-check supports .
This page is licensed: CC BY-SA / Gnu FDL
Explore table-related tools for MariaDB Server. This section details various utilities for managing table structures, performing maintenance, and optimizing data storage.
-C, --check-only-changed
Check only tables that have changed since last check or haven't been closed properly.
-g, --check-upgrade
Check tables for version-dependent changes. May be used with --auto-repair to correct tables requiring version-dependent updates. Automatically enables the --fix-db-names and --fix-table-names options. Used .
--compress
Compress all information sent between the client and server if both support compression.
-B, --databases
Check several databases. Note that normally mariadb-check treats the first argument as a database name, and following arguments as table names. With this option, no tables are given, and all name arguments are regarded as database names.
## , --debug[=name]
Output debug log. Often this is d:t:o,filename.
--debug-check
Check memory and open file usage at exit.
--debug-info
Print some debug info at exit.
--default-auth=plugin
Default authentication client-side plugin to use.
--default-character-set=name
Set the default .
-e, --extended
Used with --check, it ensures that the table is fully consistent, but this takes a long time. Used with --repair, it forces the usage of the old, slow, repair mechanism with keycache method, instead of the much faster repair by sorting.
-F, --fast
Check only tables that haven't been closed properly.
--fix-db-names
Convert database names to the format used since MySQL 5.1. Only database names that contain special characters are affected. Used from an old MySQL version.
--fix-table-names
Convert table names (including ) to the format used since MySQL 5.1. Only table names that contain special characters are affected. Used from an old MySQL version.
--flush
Flush each table after check. This is useful if you don't want to have the checked tables take up space in the caches after the check.
-f, --force
Continue even if we get an SQL error.
-?, --help
Display this help message and exit.
-h name, --host=name
Connect to the given host.
-m, --medium-check
Faster than extended-check, but only finds 99.99 percent of all errors. This should be good enough for most cases.
-o, --optimize
Optimize tables.
-p, --password[=name]
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. If you omit the password value following the --password or -p option on the command line, mariadb-check prompts for one. Specifying a password on the command line should be considered insecure. You can use an option file to avoid giving the password on the command line.
-Z, --persistent
When using ANALYZE TABLE (--analyze), it uses the PERSISTENT FOR ALL option, which forces for this table to be updated.
-W, --pipe
On Windows, connect to the server via a named pipe. This option applies only if the server supports named-pipe connections.
--plugin-dir
Directory for client-side plugins.
-P num, --port=num
Port number to use for connection or 0 for default to, in order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306).
--process-tables
Perform the requested operation (check, repair, analyze, optimize) on tables. Enabled by default. Use --skip-process-tables to disable.
--process-views[=val]
Perform the requested operation (only or ). Possible values are NO, YES (correct the checksum, if necessary, add the mariadb-version field), UPGRADE_FROM_MYSQL (same as YES and toggle the algorithm MERGE<->TEMPTABLE.
--protocol=name
The connection protocol (tcp, socket, pipe, memory) to use for connecting to the server. Useful when other connection parameters would cause a protocol to be used other than the one you want.
-q, --quick
If you are using this option with CHECK TABLE, it prevents the check from scanning the rows to check for wrong links. This is the fastest check. If you are using this option with REPAIR TABLE, it tries to repair only the index tree. This is the fastest repair method for a table.
-r, --repair
Can fix almost anything except unique keys that aren't unique.
--shared-memory-base-name
Shared-memory name to use for Windows connections using shared memory to a local server (started with the --shared-memory option). Case sensitive.
-s, --silent
Print only error messages.
--skip-database
Don't process the database (case sensitive) specified as argument.
-S name, --socket=name
For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use.
--ssl
Enables . TLS is also enabled even without setting this option when certain other TLS options are set. The --ssl option does not enable by default. In order to verify the server certificate, you must specify the --ssl-verify-server-cert option.
--ssl-ca=name
Defines a path to a PEM file that should contain one or more X509 certificates for trusted Certificate Authorities (CAs) to use for . This option requires that you use the absolute path, not a relative path. See for more information. This option implies the --ssl option.
--ssl-capath=name
Defines a path to a directory that contains one or more PEM files that should each contain one X509 certificate for a trusted Certificate Authority (CA) to use for . This option requires that you use the absolute path, not a relative path. The directory specified by this option needs to be run through the command. See for more information. This option is only supported if the client was built with OpenSSL or yaSSL. If the client was built with GnuTLS or Schannel, then this option is not supported. See for more information about which libraries are used on which platforms. This option implies the --ssl option.
--ssl-cert=name
Defines a path to the X509 certificate file to use for . This option requires that you use the absolute path, not a relative path. This option implies the --ssl option.
--ssl-cipher=name
List of permitted ciphers or cipher suites to use for . This option implies the --ssl option.
--ssl-crl=name
Defines a path to a PEM file that should contain one or more revoked X509 certificates to use for . This option requires that you use the absolute path, not a relative path. See for more information. This option is only supported if the client was built with OpenSSL or Schannel. If the client was built with yaSSL or GnuTLS, then this option is not supported. See for more information about which libraries are used on which platforms.
--ssl-crlpath=name
Defines a path to a directory that contains one or more PEM files that should each contain one revoked X509 certificate to use for . This option requires that you use the absolute path, not a relative path. The directory specified by this option needs to be run through the command. See for more information. This option is only supported if the client was built with OpenSSL. If the client was built with yaSSL, GnuTLS, or Schannel, then this option is not supported. See for more information about which libraries are used on which platforms.
--ssl-key=name
Defines a path to a private key file to use for . This option requires that you use the absolute path, not a relative path. This option implies the --ssl option.
--ssl-verify-server-cert
Enables . This option is disabled by default.
--tables
Overrides the --databases or -B option such that all name arguments following the option are regarded as table names.
--use-frm
For repair operations on MyISAM tables, get table structure from .frm file, so the table can be repaired even if the .MYI header is corrupted.
-u, --user=name
User for login if not current user.
-v, --verbose
Print info about the various stages. You can give this option several times to get even more information. See , below.
-V, --version
Output version information and exit.
--write-binlog
Write ANALYZE, OPTIMIZE, and REPAIR TABLE statements to the . Enabled by default; use --skip-write-binlog when commands should not be sent to replication slaves.
mysqlrepair
The default option is -r (--repair).
mysqlanalyze
The default option is -a (--analyze).
mysqloptimize
The default option is -o (--optimize).
-A, --all-databases
Check all the databases. This is the same as --databases with all databases selected.
-1, --all-in-1
Instead of issuing one query for each table, use one query per database, naming all tables in the database in a comma-separated list.
-a, --analyze
Analyze given tables.
--auto-repair
If a checked table is corrupted, automatically fix it. Repairing is done after all tables have been checked.
--character-sets-dir=name
Directory where character set files are installed.
-c, --check
Check table for errors.
--print-defaults
Print the program argument list and exit.
--no-defaults
Don't read default options from any option file.
--defaults-file=#
Only read default options from the given file #.
--defaults-extra-file=#
Read this file after the global files are read.
--defaults-group-suffix=#
In addition to the default option groups, also read option groups with this suffix.
[mysqlcheck]
Options read by mysqlcheck, which includes both MariaDB Server and MySQL Server.
[mariadb-check]
Options read by mariadb-check.
[client]
Options read by all MariaDB and MySQL client programs, which includes both MariaDB and MySQL clients. For example, mysqldump.
[client-server]
Options read by all MariaDB client programs and the MariaDB Server. This is useful for options like socket and port, which is common between the server and the clients.
[client-mariadb]
Options read by all MariaDB client programs.
mariadb-fix-extensions converts the extensions for (or ISAM) table files to their canonical forms.
It looks for files with extensions matching any lettercase variant of .frm, .myd, .myi, .isd
./client/mariadb-check [OPTIONS] database [tables]./client/mariadb-check [OPTIONS] --databases DB1 [DB2 DB3...]./client/mariadb-check [OPTIONS] --all-databases./client/mariadb-check --print-defaults
./client/mariadb-check --help.ism.frm.MYD.MYI.ISD.ISMInvoke mariadb-fix-extensions as follows, where data_dir is the path name to the MariaDB data directory:
This page is licensed: CC BY-SA / Gnu FDL
mariadb-fix-extensions data_dir