Beruflich Dokumente
Kultur Dokumente
Intro
MySQL and the MySQL logo are registered trademarks of MySQL AB (a Swedish company)
The MySQL software delivers a very fast, multi-threaded, multiuser, and robust SQL (Structured Query Language) database server
The MySQL Web site (http://www.mysql.com/) provides the latest information about MySQL and MySQL AB the AB part of the company name is the acronym for the Swedish aktiebolag, or stock company
License
The MySQL software is Dual Licensed
Users can choose to use the MySQL software as an Open Source product under the terms of the GNU General Public License Users can purchase a standard commercial license from MySQL AB
Documentation
The MySQL Database Software is under constant development, and the Reference Manual is updated frequently as well. The most recent version of the manual is available online in searchable form at http://dev.mysql.com/doc/ Formats available: HTML
PDF CHM
Generally speaking, you should use the binary distribution. It is simpler to use than the others, and you need no additional tools to get MySQL up and running
If you plan to connect to the MySQL server via ODBC, you also need a Connector/ODBC driver If you need tables with a size larger than 4GB, install MySQL on an NTFS or newer filesystem
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
Limits
Handles large databases.
We use MySQL Server with databases that contain 50 million records We also know of users who use MySQL Server with 60,000 tables and about 5,000,000,000 rows
Connectivity
Clients can connect to the MySQL server using TCP/IP sockets on any platform The Connector/ODBC (MyODBC) 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.
The Connector/J interface provides MySQL support for Java client programs that use JDBC connections
Windows users please note: FAT and VFAT (FAT32) are not considered suitable for production use with MySQL. Use NTFS instead
Entering Queries
mysql> SELECT VERSION( ), CURRENT_DATE;
When you issue a command, mysql sends it to the server for execution and displays the results, then prints another mysql> prompt to indicate that it is ready for another command.
Notes
Notes (2)
mysql displays query output in tabular form (rows and columns). The first row contains labels for the columns. The rows following are the query results.
Notes (3)
mysql shows how many rows were returned and how long the query took to execute, which gives you a rough idea of server performance
Entering Queries
Keywords may be entered in any lettercase. The following queries are equivalent:
mysql> SELECT VERSION(), CURRENT_DATE; mysql> select version(), current_date; mysql> SeLeCt vErSiOn(), current_DATE;
Entering Queries
Here's another query. It demonstrates that you can use mysql as a simple calculator
Entering Queries
You can even enter multiple statements on a single line. Just end each one with a semicolon
Entering Queries
A command need not be given all on a single line, so lengthy commands that require several lines are not a problem mysql determines where your statement ends by looking for the terminating semicolon, not by looking for the end of the input line
Entering Queries
Entering Queries
The following table shows each of the prompts you may see and summarizes what they mean about the state that mysql is in: mysql> Ready for new command. -> Waiting for next line of multiple-line command > Waiting for next line, waiting for completion of a string that began with a single quote (')
Entering Queries
"> Waiting for next line, waiting for completion of a
Entering Queries
Entering Queries
mysql> SELECT * FROM my_table WHERE name = 'Smith AND age < 30; '>
Creating a Table
Creating the database is the easy part, but at this point it's empty, as SHOW TABLES tells you:
Creating a Table
Creating the database is the easy part, but at this point it's empty, as SHOW TABLES tells you:
Creating a Table
Create table slides (id integer, contents varchar(30), images char);
Creating a Table
mysql> show tables;
Creating a Table
mysql> describe slides;
Source
Source