Database Articles

Page 192 of 547

MySQL Administrative and Utility Programs

AmitDiwan
AmitDiwan
Updated on 10-Mar-2021 316 Views

Let us look at the administrative and utility programs in MySQL and understand how they can be used −ibd2sdiIt is a utility to extract serialized dictionary information (SDI) from InnoDB tablespace files. SDI data is present all persistent InnoDB tablespace files. ibd2sdi can be used at runtime or when the server is offline.innochecksumIt prints the checksums for InnoDB files. It reads an InnoDB tablespace file, calculates the checksum for every page, compares the calculated checksum to the stored checksum, and reports mismatches, which show the damaged pages. It was originally developed to speed up the verification of the integrity of ...

Read More

Display MySQL Database, Table, and Column Information

AmitDiwan
AmitDiwan
Updated on 10-Mar-2021 413 Views

The mysqlshow client can be used to see what databases exist, their tables, or a table's columns or indexes.It provides a command-line interface for several SQL SHOW statements.Invoke mysqlshowThe mysqlshow utility can be invoked as shown below −shell> mysqlshow [options] [db_name [tbl_name [col_name]]]Here, If no database is provided, a list of database names are displayed.If no table is given, all matching tables in the database are displayed.If no column is provided, all matching columns and column types in the table are shown.The output displays the names of only those databases, tables, or columns for which the user has certain privileges.Optionsmysqlshow ...

Read More

mysqlimport - A MySQL Data Import Program

AmitDiwan
AmitDiwan
Updated on 10-Mar-2021 614 Views

The mysqlimport client comes with a command-line interface that helps with the LOAD DATA SQL statement. Most options to mysqlimport respond directly to clauses of LOAD DATA syntaxInvoking mysqlimportThe utility mysqlimport can be invoked as shown below −shell> mysqlimport [options] db_name textfile1 [textfile2 ...]For every text file that is named on the command line, mysqlimport strips any extension from the file name and uses the result to figure out the name of the table into which the file's contents have to be imported.ExampleLet us take an example: Files named sample.txt, sample.text, and sample all would be imported into a table ...

Read More

mysqldump - A MySQL Database Backup Program

AmitDiwan
AmitDiwan
Updated on 10-Mar-2021 551 Views

The mysqldump client utility helps performs logical backups, thereby producing a set of SQL statements which can be executed to reproduce the original database object definitions and table data.mysqldump UsageIt dumps one or more MySQL databases for backup or transfer to another SQL server.The mysqldump command also generates output in CSV, other delimited text, or XML format.The utility mysqldump requires at least the SELECT privilege for dumped tables, SHOW VIEW for dumped views, TRIGGER for dumped triggers, LOCK TABLES if the --single-transaction option is not used, and PROCESS if --no-tablespaces option is not used.The databases can be cloned for the ...

Read More

mysqladmin - A MySQL Server Administration Program

AmitDiwan
AmitDiwan
Updated on 10-Mar-2021 692 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
AmitDiwan
Updated on 10-Mar-2021 486 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
AmitDiwan
Updated on 10-Mar-2021 1K+ 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
AmitDiwan
Updated on 10-Mar-2021 633 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
AmitDiwan
Updated on 10-Mar-2021 587 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
AmitDiwan
Updated on 10-Mar-2021 2K+ 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
Showing 1911–1920 of 5,468 articles
« Prev 1 190 191 192 193 194 547 Next »
Advertisements