Found 4220 Articles for MySQLi

mysqlcheck - A MySQL Table Maintenance Program

AmitDiwan
Updated on 10-Mar-2021 12:57:10

467 Views

The mysqlcheck client performs table maintenance. It checks, repairs, optimizes, or analyses tables. If the user uses the --databases or --all-databases option to process all tables in one or more databases, invoking mysqlcheck would take a long time. This is true for the MySQL upgrade procedure as well, if it determines that the table checking is required since it processes tables in the same way.mysqlcheck UsageThe command mysqlcheck should be used when the mysqld server is running. This means that the user need not have to stop the server to perform table maintenance. It uses the SQL statements such as ... Read More

mysqladmin - A MySQL Server Administration Program

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

403 Views

The ‘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.The mysqladmin can be invoked by using the below command −shell> mysqladmin [options] command [command-arg] [command [command-arg]] ...Let us see some of the commands which mysqladmin supports. Some commands take an argument following the command name.create db_nameThis command creates a new database named db_name.drop db_nameIt deletes the database named db_name and all its tables.extended-statusIt displays the server status variables and their values.flush-hostsIt flushes all information in the host cache.flush-privilegesIt reloads ... Read More

MySQL Client Tips

AmitDiwan
Updated on 10-Mar-2021 12:54:13

284 Views

Let us understand some of the client tips that are provided by MySQL −Input-Line EditingMysql supports input-line editing, which allows the user to modify the current input line in place or recall the previous input lines.Disabling Interactive HistoryThe up-arrow key allows the user to recall input lines from current and previous sessions. In case where a console is shared, this behaviour may not be suited. mysql supports disabling of the interactive history partially or fully, and this depends on the host platform.On Windows, the history is stored in memory. The keys ‘Alt+F7’ will delete all input lines stored in memory ... Read More

Executing SQL Statements from a Text File on MySQL Client

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

770 Views

Let us understand how SQL statements can be executed from a text file on the MySQL client. The mysql client is generally used in interactive way. Let us see an example of the same −shell> mysql db_namePlace SQL Satements in a Text FileIt is also possible to put the SQL statements in a file and then tell mysql to read the input from that specific file. To do this, a text file text_file is first created.This text file would contain the statements that need to be executed. Let us take an example to understand the same −shell> mysql db_name < ... Read More

MySQL Client Server-Side Help

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

394 Views

Let us understand the MySQL client-server side help −mysql> help search_stringIf an argument is provided to the above ‘help’ command, mysql will use it as a search string to access server-side help from the contents of the MySQL Reference Manual. The proper operation of this command needs that the help tables in the mysql database should be initialized with help topic information.If there is no match for the search string, then the search operation fails. Let us take an example to understand this −mysql> help meOutputNothing found Please try to run 'help contents' for a list of all accessible topicsWe ... Read More

MySQL Client Logging

AmitDiwan
Updated on 10-Mar-2021 12:51:05

278 Views

Let us understand about client logging with respect to MySQL. The mysql client can do different types of logging for statements that are executed, and it can be interactively −UNIX - LoggingOn Unix, mysql writes the statements to a history file. By default, this file is named as .mysql_history in the user’s home directory. To specify a different file name, the value of the MYSQL_HISTFILE environment variable has to be set.If the --syslog option is given, mysql will write the statements to the system logging facility on all kinds of platforms. On Unix, this is known as syslog.Windows - LoggingOn ... Read More

MySQL Client Commands

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

881 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

217 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

862 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

2K+ 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

Advertisements