
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 4219 Articles for MySQLi

339 Views
Optimizing MySQL tables is a crucial step in improving the performance and efficiency of your database. By employing effective optimization techniques, you can enhance query execution speed, reduce storage requirements, and optimize resource utilization. This article explores various strategies and best practices to optimize MySQL tables, allowing you to maximize the performance of your database-driven applications. In this guide, we will discuss the importance of analyzing table structure and design, selecting appropriate data types, and normalizing the database schema. We will also delve into indexing strategies, including identifying indexing opportunities and optimizing indexes for query performance. Additionally, we will explore ... Read More

672 Views
It is common to select certain data or rows from a table. The rows are returned in the order in which they appear in the table. We may sometimes require that the rows we select from the table must be returned to us in ascending or descending order with respect to some column.The “ORDER BY” statement is used to order the results with respect to some column. The following example will provide more clarity.Suppose, we have a table which consists of various fields including the “name” field. We want to select all the rows from the table but we want ... Read More

3K+ Views
In this post, we will understand the difference between the ALTER command and the UPDATE command in SQL.ALTER CommandThis command is a Data Definition Language (DDL).It performs operation at the structural level, not the data level.This command is used to add, delete, and modify the attributes of the tables in a database.This command, by default, initializes the values of all values in the tuple to NULL.It changes the structure of the table.Syntax: Add a column −ALTER TABLE table_name ADD column_name datatype;Drop a ColumnALTER TABLE table_name DROP COLUMN column_name;UPDATE CommandThis command is a Data Manipulation Language (DML).It performs operations on the ... Read More

1K+ Views
MySQL uses port number 3306 by default.3306 Port Number3306 port number is used by MySQL protocol to connect with the MySQL clients and utilities such as ‘mysqldump’. It is a TCP, i.e Transmission Control Protocol.VulnerabilitiesLet us see if there are any vulnerabilities while using this default port −In general, port 3306 shouldn’t be opened since it could make the server vulnerable to attack. If the user needs to connect to the database remotely, there are many other secure options, instead of opening the port 3306.One of the secure options includes using an SSH tunnel. On the other hand, if it ... Read More

399 Views
To determine the connection method that is used by MySQL connection, the below command can be used −netstat −ln | grep 'mysql'On Unix, MySQL programs treat the host name ‘localhost’ in a special manner. Hence, it behaves differently than what is expected of it.Type of ConnectionTo know the type of connection from within the mysql CLI, the below command can be used −mysql> \sOutput −Connection: 127.0.0.1 via TCP/IP (or) Connection: Localhost via UNIX socketTCP/IP connection to the local serverTo ensure that the client makes a TCP/IP connection to the local server, the --host or -h can be used. This will ... Read More

224 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

291 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

640 Views
The mysqlpump client utility performs logical backups, thereby producing a set of SQL statements that would be executed to reproduce the original database object definitions and table data. It helps dump one or more MySQL databases for backup or transfer to another SQL server.Features of mysqlpumpLet us understand the features of mysqlpump −Parallel processing of databases, as well as that of objects within databases, thereby helping speed up the dump process.It provides better control over which databases and database objects (tables, stored programs, user accounts) need to be dumpedDumping of user accounts as account-management statements (CREATE USER, GRANT) instead of ... Read More

483 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

410 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