The Main Features of MySQL

The following list describes some of the important characteristics of the MySQL Database Software. See MySQL 4.0 Nutshell.

Internals and Portability
  • Written in C and C++.

  • Tested with a broad range of different compilers.

  • Works on many different platforms. See Which OS.

  • Uses GNU Automake, Autoconf, and Libtool for portability.

  • APIs for C, C++, Eiffel, Java, Perl, PHP, Python, Ruby, and Tcl are available. See Clients.

  • Fully multi-threaded using kernel threads. This means it can easily use multiple CPUs if they are available.

  • Provides transactional and non-transactional storage engines.

  • Uses very fast B-tree disk tables (MyISAM) with index compression.

  • Relatively easy to add another storage engine. This is useful if you want to add an SQL interface to an in-house database.

  • A very fast thread-based memory allocation system.

  • Very fast joins using an optimized one-sweep multi-join.

  • In-memory hash tables which are used as temporary tables.

  • SQL functions are implemented using a highly optimized class library and should be as fast as possible. Usually there is no memory allocation at all after query initialization.

  • The MySQL code is tested with Purify (a commercial memory leakage detector) as well as with Valgrind, a GPL tool (http://developer.kde.org/~sewardj/).

  • The server is available as a separate program for use in a client/server networked environment. It is also available as a library that can be embedded (linked) into standalone applications. Such applications can be used in isolation or in environments where no network is available.

 
Column Types
  • Many column types: signed/unsigned integers 1, 2, 3, 4, and 8 bytes long, FLOAT, DOUBLE, CHAR, VARCHAR, TEXT, BLOB, DATE, TIME, DATETIME, TIMESTAMP, YEAR, SET, ENUM, and OpenGIS geometry types. See Column types.

  • Fixed-length and variable-length records.

 
Commands and Functions
  • Full operator and function support in the SELECT and WHERE clauses of queries. For example:

          mysql> SELECT CONCAT(first_name, ' ', last_name)
              -> FROM tbl_name
              -> WHERE income/dependents > 10000 AND age > 30;
          
  • Full support for SQL GROUP BY and ORDER BY clauses. Support for group functions (COUNT(), COUNT(DISTINCT ...), AVG(), STD(), SUM(), MAX(), MIN(), and GROUP_CONCAT()).

  • Support for LEFT OUTER JOIN and RIGHT OUTER JOIN with both standard SQL and ODBC syntax.

  • Support for aliases on tables and columns as required by SQL-92.

  • DELETE, INSERT, REPLACE, and UPDATE return the number of rows that were changed (affected). It is possible to return the number of rows matched instead by setting a flag when connecting to the server.

  • The MySQL-specific SHOW command can be used to retrieve information about databases, tables, and indexes. The EXPLAIN command can be used to determine how the optimizer resolves a query.

  • Function names do not clash with table or column names. For example, ABS is a valid column name. The only restriction is that for a function call, no spaces are allowed between the function name and the ( that follows it. See Reserved words.

  • You can mix tables from different databases in the same query (as of Version 3.22).

 
Security
  • A privilege and password system that is very flexible and secure, and allows host-based verification. Passwords are secure because all password traffic is encrypted when you connect to a server.

 
Scalability and Limits
  • Handles large databases. We use MySQL Server with databases that contain 50 million records. We also know of users that use MySQL Server with 60,000 tables and about 5,000,000,000 rows.

  • Up to 32 indexes per table are allowed. Each index may consist of 1 to 16 columns or parts of columns. The maximum index width is 500 bytes (this may be changed when compiling MySQL Server). An index may use a prefix of a CHAR or VARCHAR column.

 
Connectivity
  • Clients may connect to the MySQL server using TCP/IP sockets on any platform. On Windows systems in the NT family (NT, 2000, or XP), clients may connect using named pipes. On Unix systems, clients may connect using Unix domain socket files.

  • The Connector/ODBC interface provides MySQL support for client programs that use ODBC (Open-DataBase-Connectivity) connections. For example, you can use MS Access to connect to your MySQL server. Clients may be run on Windows or Unix. Connector/ODBC source is available. All ODBC 2.5 functions are supported, as are many others. See ODBC.

  • The Connector/JDBC interface provides MySQL support for Java client programs that use JDBC connections. Clients may be run on Windows or Unix. Connector/JDBC source is available. See Java.

 
Localization
  • The server can provide error messages to clients in many languages. See Languages.

  • Full support for several different character sets, including ISO-8859-1 (Latin1), german, big5, ujis, and more. For example, the Scandinavian characters â, ä and ö are allowed in table and column names. Unicode support is available as of MySQL 4.1.

  • All data is saved in the chosen character set. All comparisons for normal string columns are case-insensitive.

  • Sorting is done according to the chosen character set (the Swedish way by default). It is possible to change this when the MySQL server is started. To see an example of very advanced sorting, look at the Czech sorting code. MySQL Server supports many different character sets that can be specified at compile and runtime.

 
Clients and Tools
  • The MySQL server has built-in support for SQL statements to check, optimize, and repair tables. These statements are available from the command line through the mysqlcheck client. MySQL also includes myisamchk, a very fast command-line utility for performing these operations on MyISAM tables. See MySQL Database Administration.

  • All MySQL programs can be invoked with the --help or -? options to obtain online assistance.