Introduction to MySQL

Source: Internet
Author: User
Tags contains file system join mysql mysql client new features query wrapper

MySQL is a semi commercial database that is popular with people in the Linux community. MySQL is available to run on most Linux platforms (I386,SPARC,ETC), as well as a few non-Linux or even non-UNIX platforms.

1. License fee

MySQL's popularity largely stems from its ease, except for a slightly unusual license fee. The price of MySQL varies with the platform and installation mode. MySQL Windows versions (NT and 9X) are not free under any circumstances, and any UNIX variant (including Linux) MySQL is free if it is installed by the user or by the system administrator rather than by a third party, and the third scheme must pay the license fee.

2. Price

Platform Installation method Price
Windows nt,9x any 200 dollars
Free UNIX or Linux installation
Unix or Linux third party installation 200 USD
Requires an application component of 200 dollars

Can get a variety of support contracts, too much content is no longer listed, the latest quotations can be consulted MySQL site.

3, installation

Most of the major package formats (RPM, DBE, TGZ) can be obtained at the MySQL site, and the client library and various language "wrappers" (wrapper) can be obtained in separate RPM formats. The RPM format installation is not much of a hassle and requires no initial configuration. The RC3.D (for example, redhat RPM) generates an initial script, so the MySQL daemon is started when restarted in multiuser mode. The MySQL daemon (mysqld) consumes very little memory (the overhead of each daemon using 500K memory and 4 m shared memory on Pentium 133 running Redhat 5.1) and is loaded onto the processor only when executing a real query, which means that for a small database, MySQL can be used fairly easily without having too much impact on other system functions.

4. Data type

A field that supports a large number of data types is a good thing. The usual integers, floating-point numbers, strings, and numbers are expressed in a variety of lengths and support the variable-length blob (Binary Large OBject) type. The integer digit segment is represented by the AutoIncrement option, and the Date Time field.

MySQL differs from most other database systems by providing two relatively infrequently used field types: Enum and set. An enum is a type of enumeration that is very good for Pascal-language enumeration types that allow programmers to see field values similar to ' Red, ' green ', ' Blue ', and MySQL stores only these values as one byte. Set is also borrowed from Pascal, it is also an enumeration type, but a single field can store multiple values at once, this ability to store multiple enumeration values may not give you some impression (and may threaten the third paradigm definition), but proper use of set and contains keywords can save a lot of table joins, Can achieve good performance improvement.

5. SQL compatibility

MySQL contains a number of transformations that are different from the SQL standard, and most of them are designed to compensate for the inadequacy of the SQL language scripting language. However, other extensions do make MySQL unique, for example, a link clause search that automatically ignores case. MySQL also allows user-defined SQL functions, in other words, a programmer can write a function and then integrate it into MySQL, and it behaves no differently from any basic function such as SUM () or AVG (). The function must be compiled into a shared library file (. so file), and then loaded with a load function command.

It also lacks some of the commonly used SQL features, with no sub selections (queries in queries). The view is gone. Of course most subqueries can be overridden with a simple join clause, but sometimes it's easier to think about a problem with two nested queries than a big one. Similarly, the view only hides the WHERE clause for the programmer, but that is another convenience that programmers expect.

6, stored procedures and triggers

MySQL does not have a stored procedure (Stored Procedure) language, which is the biggest limitation for programmers accustomed to enterprise-class databases. Multi-statement SQL commands must be coordinated by client code, which allows for multiple statements to run, thanks to a fairly robust query language and the ability to lock and unlock tables with clients.

7. Referential integrity (referential Integrity-ri)

One of the main drawbacks of MySQL is the lack of a standard RI mechanism; however, MySQL creators are not ignoring the wishes of their users and providing some solutions. One of these is to support a unique index. The lack of rule restrictions (a fixed range limit on the domain of the Spike field) is compensated by a large number of data types. does not simply provide a check constraint (the limit of the value of one field to another field in the same row), an external keyword, and a "cascade delete" feature that is often associated with RI. Interestingly, when these features are not supported, the SQL parser tolerates the syntax of these statements. This is done to easily migrate the database to MySQL. This is a good attempt, and it really leaves the door for future support; However, those who do not read the document carefully may mistakenly assume that these functions actually exist.

7. Safety

The biggest complaint I ever had about MySQL was its security system, whose only drawback was complexity, not standard, and only changed when Mysqladmin was invoked to reread the user's permissions. The usual SQL Grant/revoke statements are supported in the most recent version, but at least they are now available. MySQL's authors have extensively documented their specific security systems, but they do need a learning process that may be the only way to do it.

8, backup and recovery, data import/Export

The lack of mandatory reference consistency significantly simplifies backup and recovery, which is perfectly replicated by data import/export. The LOAD Data infile command gives a lot of flexibility to data import. The SELECT into command implements the equality function of data export. In addition, since MySQL does not use the original partition, all database data can be saved with a single file system backup. Database activities can be recorded. Unlike the usual database logs (which store record changes or before/after recording images), MySQL records the actual SQL statements. This allows the database to be restored to the point before the failure, but does not allow commit and rollback (rollback) operations.


9, connectivity
The MySQL client library is the C language library of the client/server architecture, which means that one customer can query a database that resides on another machine. However, MySQL's real strength is in the library's language "wrapper (wrapper)", Perl, Pathon and PHP are just a few. Apache Web servers also have many modules such as directory Access files that allow a wide variety of Apache configuration information (such as directory Access files) to use MySQL, and the application interface is simple, consistent, and complete. In addition, multiple platform ODBC drivers are freely available.

10. The future

The development of MySQL continues to take place quickly. In fact, the pace of development is a challenge for most open source code. There are a number of new features that are being addressed in this article, but I will not comment on features that do not yet exist. Developers have shown me the highest priority in future development by adding query capabilities and increasing query speed.

11, summary
MySQL is the centre of the database field. It lacks most of the main features of a full-featured database, but there are more features than similar xbase record storage engines. It needs an Active server daemon like an enterprise-class RDBMS, but it cannot consume resources as they do. The query language allows for complex connection (join) queries, but all reference integrity must be guaranteed by the programmer.

MySQL finds a place in the Linux world-providing simplicity and speed while still providing enough functionality to make programmers happy. Database programmers will like their query capabilities and a wide range of customer libraries, and database administrators will find that the system lacks primary database functionality and they will find it valuable for simple databases (when it is not guaranteed to buy a large database).







Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.