MySQL Client Commands

AmitDiwan
Updated on 10-Mar-2021 12:50:00

1K+ Views

Let us understand some of the MySQL client commands −MySQL sends every SQL statement that the user issues to the server so that it can be executed. There is also a set of commands that mysql interprets on its own.Get the List of CommandsThe list of these commands can be found by typing the below mentioned command on the prompt −mysql> helpOutputList of all MySQL commands: Note that all text commands must be first on line and end with ';' ? (\?) Synonym for `help'. clear     (\c) Clear the current input statement. connect   (\r) Reconnect to the ... Read More

MySQL Client Options

AmitDiwan
Updated on 10-Mar-2021 12:47:49

421 Views

The mysql supports the below mentioned options, which can be specified on the command line or in the [mysql] and [client] groups of an option file.--help, -?It helps display a help message and exit.--auto-rehashIt enables automatic rehashing. This option is set by default, which enables database, table, and column name completion.--auto-vertical-outputThis option causes the result sets to be displayed vertically if they are too wide for the current window, and it uses the normal tabular format otherwise.--batch, -BIt prints the results using tab as the column separator, with each row on a new line. With this option, mysql doesn’t use ... Read More

The MySQL Command Line Client

AmitDiwan
Updated on 10-Mar-2021 12:45:56

1K+ Views

The mysql is a simple SQL shell that has input line editing capabilities. It supports interactive and noninteractive usage. When it is used interactively, query results are presented in an ASCII-table format. When it is used noninteractively, like a filter, the result would be presented in tab-separated format.The output format can be changed with the help of command options. If there are issues because of insufficient memory for large result sets, the --quick option can be used.This forces the mysql to retrieve results from the server, a row at a time instead of retrieving the entire result set at once ... Read More

MySQL Client Programs

AmitDiwan
Updated on 10-Mar-2021 12:44:27

3K+ Views

There are 7 client programs, which are listed below −mysqlmysqladminmysqlcheckmysqldumpmysqlimportmysqlpumpmysqlshowmysqlslapLet us understand the MySQL client programs in brief −mysqlThe mysql is a simple SQL shell that has input line editing capabilities. It supports interactive and noninteractive usage. When it is used interactively, query results are presented in an ASCII-table format.It can be invoked from the prompt of the user’s command interpreter. It has been demonstrated below −shell> mysql db_namemysqladminThe mysqladmin is a client that helps perform administrative operations. It can also be used to check the server's configuration and current status, to create and drop databases, and much more.mysqlcheckThe mysqlcheck ... Read More

Check and Upgrade MySQL Tables

AmitDiwan
Updated on 10-Mar-2021 12:43:31

923 Views

Let us understand mysql_upgrade program −UsageEvery time MySQL is upgraded, the user should execute mysql_upgrade, that looks for incompatibilities with the upgraded MySQL server.It upgrades the system tables in the mysql schema so that the user can take advantage of new privileges or capabilities that could have been added after the upgrade.It basically upgrades the Performance Schema and sys schema.It also examines user schemas.If mysql_upgrade finds that a table has a possible incompatibility, it performs a table check and, if some problems are found, attempts a table repair operationThe mysql_upgrade can be used as shown below −Ensure that the server ... Read More

Load Time Zone Tables in MySQL using tzinfo-to-sql

AmitDiwan
Updated on 10-Mar-2021 12:42:21

1K+ Views

The mysql_tzinfo_to_sql program helps load the time zone tables in the mysql database. It is used on systems which have a zoneinfo database, i.e the set of files that describe the time zones. Examples of such systems include Linux, FreeBSD, Solaris, and macOS. One most probable location for these files is the /usr/share/zoneinfo directory (/usr/share/lib/zoneinfo on Solaris).Invoking mysql_tzinfo_to_sqlIf the system doesn’t have a zoneinfo database, the downloadable package can be installed. The mysql_tzinfo_to_sql can be invoked in many ways. Some of them have been shown below −shell> mysql_tzinfo_to_sql tz_dir (or) shell> mysql_tzinfo_to_sql tz_file tz_name (or) shell> mysql_tzinfo_to_sql --leap tz_fileIn the ... Read More

Create SSL RSA Files in MySQL

AmitDiwan
Updated on 10-Mar-2021 12:41:22

703 Views

Let us understand mysql_ssl_rsa_setup program −This program helps create the SSL certificate, key files and the RSA key-pair files that are required to support secure connections with the help of SSL and secure password exchange using RSA over unencrypted connections, if they are missing. The mysql_ssl_rsa_setup program can be used to create new SSL files if the existing ones have expired.Invoking mysql_ssl_rsa_setupThe mysql_ssl_rsa_setup can be invoked as shown below −shell> mysql_ssl_rsa_setup [options]Some of the options include --datadir which is used to specify where to create the files, and the --verbose option to see the ‘openssl’ commands that mysql_ssl_rsa_setup executes.The ‘mysql_ssl_rsa_setup’ ... Read More

Improve MySQL Installation Security with Secure Installation

AmitDiwan
Updated on 10-Mar-2021 12:39:07

559 Views

What is mysql_secure_installation?Let us understand the MySQL installation related program mysql_secure_installation −This program enables the user to improve the security of their MySQL installation in the below mentioned ways:The user can set a password for root accounts.The user can remove root accounts which are accessible from outside the local host.The user can remove anonymous-user accounts.The user can remove the test database which, by default, can be accessed by all users, even anonymous users), and privileges that permit anyone to access databases with names that start with test_.The mysql_secure_installation helps the user to implement security recommendations.Normal usage is to connect to ... Read More

Configure MySQL Server Plugins

AmitDiwan
Updated on 10-Mar-2021 12:37:59

549 Views

Let us understand mysql_plugin utlity used in MySQL −The mysql_plugin utility allows MySQL administrators to manage the plugins that a MySQL server loads.It provides an alternative to manually specify the --plugin-load option at server startup or with the help of INSTALL PLUGIN and UNINSTALL PLUGIN statements at runtime.Depending on whether mysql_plugin is invoked to enable or disable plugins, the utility inserts or deletes rows respectively, in the mysql.plugin table which serves as a plugin registry.For normal server startups, the server loads and enables the plugins which are listed in mysql.plugin automatically.For additional control over the activation of the plugin, the ... Read More

Initialize MySQL Data Directory with mysql_install_db

AmitDiwan
Updated on 10-Mar-2021 12:36:53

961 Views

The mysql_install_db handles the initialization tasks which need to be performed before the MySQL server i.e mysqld is ready to use. It initializes the MySQL data directory and helps create the system tables that it contains. It initializes the system tablespace and the related data structures that are reuqired to manage the InnoDB tables.Secure-by-Default DeploymentThe current versions of mysql_install_db would produce a MySQL deployment which is secure by default. It has the below mentioned characteristics.A single administrative account named 'root'@'localhost' is created with a randomly generated password and is marked as expired.No anonymous user accounts are created.No test database which ... Read More

Advertisements