SlideShare una empresa de Scribd logo
1 de 58
Descargar para leer sin conexión
Mysql
Basi di Dati
Universitàdi Enna A.A. 2005/06
Intro
 MySQL® and the MySQL logo are registered trademarks of
MySQL AB (a Swedish company)
 The MySQL® software delivers a very fast, multi-threaded, multi-
user, 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
 See http://www.mysql.com/company/legal/licensing/
for more information on our licensing policies.
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
Operating Systems Supported by MySQL
 It is possible to port MySQL to all modern systems
that have a C++ compiler and a working
implementation of POSIX threads
 Thread support is needed for the server. To compile
only the client code, the only requirement is a C++
compiler
 “We use and develop the software ourselves primarily
on Linux (SuSE and Red Hat), FreeBSD, and Sun
Solaris (Versions 8 and 9)”
Operating Systems Supported by MySQL
 MySQL has been reported to compile successfully on
the following operating systems:
 AIX 4.x, 5.x
 Amiga
 BSDI 2.x
 Digital Unix 4.x
 FreeBSD 2.x, 3.x, 4.x
 Mac OS X
 Windows 9x, Me, NT, 2000, XP, and 2003
Installing MySQL on Windows
 A native Windows version of MySQL has been
available from MySQL AB since version 3.21 and
represents a sizable percentage of the daily
downloads of MySQL
 The installer for the Windows version of MySQL 5.0,
combined with a GUI Configuration Wizard,
automatically installs MySQL, creates an option file,
starts the server, and secures the default user accounts
Installing MySQL on Windows
 MySQL 5.0 for Windows is available in three distribution
formats:
 The binary distribution contains a setup program that installs
everything you need so that you can start the server immediately
 The source distribution contains all the code and support files for
building the executables using the Visual Studio 2003 compiler system
 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
Installing MySQL on Windows
 A copy of the MySQL binary distribution for
Windows, which can be downloaded from
http://dev.mysql.com/downloads/
 You may also have the following optional
requirements:
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
 For MySQL 5.0, there are three installation packages
to choose from when installing MySQL on Windows.
The packages are as follows:
 Essential package
 Complete package
 Noinstall archive
 The Essentials package is recommended for most
users
Installing MySQL on Windows
 The following entries are created within the new
Start menu section:
MySQL Command Line Client : This is a shortcut to the
mysql command-line client and is configured to connect as
the root user. The shortcut prompts for a root user password
when connecting
MySQL Server Instance Config Wizard : This is a
shortcut to the MySQL Configuration Wizard. Use this
shortcut to configure a newly installed server, or to re-
configure an existing server
MySQL Documentation : This is a link to the MySQL
server documentation that is stored locally in the MySQL
server installation directory. This option is not available
when the MySQL server is installed using the Essentials
installation package.
Installing MySQL on Windows
The Main Features of MySQL
Written in C and C++
Tested with a broad range of different
compilers
Works on many different platforms
Uses GNU Automake, Autoconf, and Libtool
for portability
APIs for C, C++, Eiffel, Java, Perl, PHP,
Python, Ruby, and Tcl are 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
 Fixed-length and variable-length records
Statements and Functions
 Full operator and function support in the SELECT
and WHERE clauses of queries.
 Full support for SQL GROUP BY and ORDER BY
clauses. Support for group functions (COUNT(),
COUNT(DISTINCT ...), AVG(), STD(), SUM(),
MAX(), MIN()
 Support for LEFT OUTER JOIN and RIGHT
OUTER JOIN
 Support for aliases on tables and columns as required
by standard SQL
Statements and Functions (2)
 DELETE, INSERT, REPLACE, and UPDATE return the
number of rows that were changed (affected)
 The MySQL-specific SHOW command can be used to
retrieve information about databases, database engines, 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
 You can mix tables from different databases in the same query
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
How Big MySQL Tables Can Be
 MySQL 3.22 had a 4GB (4 gigabyte) limit on table
size.
 With the MyISAM storage engine in MySQL 3.23,
the maximum table size was increased to 65536
terabytes (2567 – 1 bytes).
 With this larger allowed table size, the maximum
effective table size for MySQL databases is usually
determined by operating system constraints on file
sizes, not by MySQL internal limits
 The following table lists some examples of operating
system file-size limits. This is only a rough guide and
is not intended to be definitive
 Win32 (FAT/FAT32) 2GB/4GB
 Win32 (NTFS) 2TB
 Linux 2.2-Intel 2GB
 Linux 2.4+ (ext3) 4TB
 Windows users please note: FAT and VFAT (FAT32)
are not considered suitable for production use with
MySQL. Use NTFS instead
How Big MySQL Tables Can Be
Connecting to and Disconnecting from
the Server
 To connect to the server, you will usually need to
provide a MySQL username when you invoke mysql
and, most likely, a password. If the server runs on a
machine other than the one where you log in, you will
also need to specify a hostname
 shell> mysql -h host -u user –p
Enter password: ********
Connecting to and Disconnecting from
the Server
 shell> mysql -h host -u user –p
Enter password: ********
 host and user represent the hostname where your
MySQL server is running and the username of your
MySQL account
 The ******** represents your password; enter it
when mysql displays the Enter password: prompt.
Connecting to and Disconnecting from
the Server
Connecting to and Disconnecting from
the Server
 Some MySQL installations allow users to connect as
the anonymous (unnamed) user to the server running
on the local host.
 If this is the case on your machine, you should be
able to connect to that server by invoking mysql
without any options:
 shell> mysql
Connecting to and Disconnecting from
the Server
 After you have connected successfully, you can
disconnect any time by typing QUIT (or EXIT) at
the mysql > prompt:
 shell> QUIT
Bye
 shell> EXIT
Bye
 On Unix, you can also disconnect by pressing Control-D
Entering Queries
 mysql> SELECT VERSION( ), CURRENT_DATE;
Notes
• 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 (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;
• 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
string that began with a double quote (‘"’)
 `> Waiting for next line, waiting for completion of an
identifier that began with a backtick (‘`’)
 /*> Waiting for next line, waiting for completion of a comment
that began with /*
Entering Queries
Entering Queries
Entering Queries
 mysql> SELECT * FROM my_table WHERE name = 'Smith AND age < 30;
 '>
Creating and Using a Database
This section shows you how to:
Create a database
Create a table
Load data into the table
Retrieve data from the table in various ways
Use multiple tables
 Use the SHOW statement to find out what databases
currently exist on the server
Creating and Using a Database
 If the test database exists, try to access it
Creating and Using a Database
USE
USE, like QUIT, does not require a semicolon
You can terminate such statements with a
semicolon if you like; it does no harm
It must be given on a single line
Creating and Using a Database
Creating and Selecting a Database
 If the administrator creates your database for you when setting
up your permissions, you can begin using it. Otherwise, you
need to create it yourself
Creating and Selecting a Database
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;
Loading Data into a Table
 After creating your table, you need to populate it. The
LOAD DATA statement is useful for this
 Because you are beginning with an empty table, an
easy way to populate it is to create a text file
containing a row for each of your slide, then load the
contents of the file into the table with a single
statement
Loading Data into a Table
Loading Data into a Table
mysql> LOAD DATA LOCAL INFILE
- > 'C:Documents and SettingsUserDocumentiDidatticaceriMysqldati
‘ > slides.txt' INTO TABLE slides;
Loading Data into a Table
mysql> LOAD DATA LOCAL INFILE
- > 'C:Documents and SettingsUserDocumentiDidatticaceriMysqldati
‘ > slides.txt' INTO TABLE slides;
Retrieving Information from a Table
mysql> select * from slides;
mysql> select contents from slides;
Retrieving Information from a Table
mysql> delete from slides;
Retrieving Information from a Table
mysql> select * from slides;
Retrieving Information from a Table
Source
Source

Más contenido relacionado

La actualidad más candente

Seo pressor unlimited-license-v4.0
Seo pressor unlimited-license-v4.0Seo pressor unlimited-license-v4.0
Seo pressor unlimited-license-v4.0Sarit Cohen
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
Introduction to xampp
Introduction to xamppIntroduction to xampp
Introduction to xamppJin Castor
 
Virtualización de Escriorios VMWare View 5
Virtualización de Escriorios VMWare View 5Virtualización de Escriorios VMWare View 5
Virtualización de Escriorios VMWare View 5RaGaZoMe
 
Open sis installation_guide
Open sis installation_guideOpen sis installation_guide
Open sis installation_guideFkrzy
 
Install WordPress Blogging Software with EasyPHP
Install WordPress Blogging Software with EasyPHPInstall WordPress Blogging Software with EasyPHP
Install WordPress Blogging Software with EasyPHPRupesh Kumar
 
A Complete Installation Guide for Orangescrum
A Complete Installation Guide for OrangescrumA Complete Installation Guide for Orangescrum
A Complete Installation Guide for OrangescrumOrangescrum
 
How Can PHP Web Development Benefits to My Business?
How Can PHP Web Development Benefits to My Business?How Can PHP Web Development Benefits to My Business?
How Can PHP Web Development Benefits to My Business?iFuturz
 
Installing WampServer
Installing WampServerInstalling WampServer
Installing WampServerDrupal Jax
 
OWA And SharePoint Integration
OWA And SharePoint IntegrationOWA And SharePoint Integration
OWA And SharePoint Integrationjems7
 
Open Mic - IBM Sametime Proxy Clustering
Open Mic - IBM Sametime Proxy ClusteringOpen Mic - IBM Sametime Proxy Clustering
Open Mic - IBM Sametime Proxy Clusteringjayeshpar2006
 
Installation xampp and WordPress on localhost
Installation xampp and WordPress on localhostInstallation xampp and WordPress on localhost
Installation xampp and WordPress on localhostLuzan Baral
 
Using aphace-as-proxy-server
Using aphace-as-proxy-serverUsing aphace-as-proxy-server
Using aphace-as-proxy-serverHARRY CHAN PUTRA
 

La actualidad más candente (18)

Seo pressor unlimited-license-v4.0
Seo pressor unlimited-license-v4.0Seo pressor unlimited-license-v4.0
Seo pressor unlimited-license-v4.0
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
Introduction to xampp
Introduction to xamppIntroduction to xampp
Introduction to xampp
 
Install
InstallInstall
Install
 
Virtualización de Escriorios VMWare View 5
Virtualización de Escriorios VMWare View 5Virtualización de Escriorios VMWare View 5
Virtualización de Escriorios VMWare View 5
 
Open sis installation_guide
Open sis installation_guideOpen sis installation_guide
Open sis installation_guide
 
Install WordPress Blogging Software with EasyPHP
Install WordPress Blogging Software with EasyPHPInstall WordPress Blogging Software with EasyPHP
Install WordPress Blogging Software with EasyPHP
 
A Complete Installation Guide for Orangescrum
A Complete Installation Guide for OrangescrumA Complete Installation Guide for Orangescrum
A Complete Installation Guide for Orangescrum
 
Php On Windows
Php On WindowsPhp On Windows
Php On Windows
 
How Can PHP Web Development Benefits to My Business?
How Can PHP Web Development Benefits to My Business?How Can PHP Web Development Benefits to My Business?
How Can PHP Web Development Benefits to My Business?
 
Doc
DocDoc
Doc
 
WordPress Manual in Compatible with XAMPP
WordPress Manual in Compatible with XAMPPWordPress Manual in Compatible with XAMPP
WordPress Manual in Compatible with XAMPP
 
Installing WampServer
Installing WampServerInstalling WampServer
Installing WampServer
 
OWA And SharePoint Integration
OWA And SharePoint IntegrationOWA And SharePoint Integration
OWA And SharePoint Integration
 
Xampp Ppt
Xampp PptXampp Ppt
Xampp Ppt
 
Open Mic - IBM Sametime Proxy Clustering
Open Mic - IBM Sametime Proxy ClusteringOpen Mic - IBM Sametime Proxy Clustering
Open Mic - IBM Sametime Proxy Clustering
 
Installation xampp and WordPress on localhost
Installation xampp and WordPress on localhostInstallation xampp and WordPress on localhost
Installation xampp and WordPress on localhost
 
Using aphace-as-proxy-server
Using aphace-as-proxy-serverUsing aphace-as-proxy-server
Using aphace-as-proxy-server
 

Similar a My sql università di enna a.a. 2005-06

Mysqlppt3510
Mysqlppt3510Mysqlppt3510
Mysqlppt3510Anuja Lad
 
MySQL Reference Manual
MySQL Reference ManualMySQL Reference Manual
MySQL Reference Manualwebhostingguy
 
SULTHAN's PHP, MySQL & wordpress
SULTHAN's PHP, MySQL & wordpressSULTHAN's PHP, MySQL & wordpress
SULTHAN's PHP, MySQL & wordpressSULTHAN BASHA
 
My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)Gustavo Rene Antunez
 
My sql technical reference manual
My sql technical reference manualMy sql technical reference manual
My sql technical reference manualMir Majid
 
SQL PPT.pptx
SQL PPT.pptxSQL PPT.pptx
SQL PPT.pptxKulbir4
 
Getting started with my sql
Getting started with my sqlGetting started with my sql
Getting started with my sqlWeb Sky
 
Database synchronization prashant parit
Database synchronization   prashant paritDatabase synchronization   prashant parit
Database synchronization prashant paritPrashantP23
 
My sql crashcourse_intro_kdl
My sql crashcourse_intro_kdlMy sql crashcourse_intro_kdl
My sql crashcourse_intro_kdlsqlhjalp
 
The mysqlnd replication and load balancing plugin
The mysqlnd replication and load balancing pluginThe mysqlnd replication and load balancing plugin
The mysqlnd replication and load balancing pluginUlf Wendel
 

Similar a My sql università di enna a.a. 2005-06 (20)

Mysqlppt3510
Mysqlppt3510Mysqlppt3510
Mysqlppt3510
 
Mysqlppt3510
Mysqlppt3510Mysqlppt3510
Mysqlppt3510
 
MySQL Reference Manual
MySQL Reference ManualMySQL Reference Manual
MySQL Reference Manual
 
Mysql tutorial
Mysql tutorialMysql tutorial
Mysql tutorial
 
SULTHAN's PHP, MySQL & wordpress
SULTHAN's PHP, MySQL & wordpressSULTHAN's PHP, MySQL & wordpress
SULTHAN's PHP, MySQL & wordpress
 
My sql basic
My sql basicMy sql basic
My sql basic
 
Mysql tutorial 5257
Mysql tutorial 5257Mysql tutorial 5257
Mysql tutorial 5257
 
Mysql
MysqlMysql
Mysql
 
My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)
 
My sql technical reference manual
My sql technical reference manualMy sql technical reference manual
My sql technical reference manual
 
SQL PPT.pptx
SQL PPT.pptxSQL PPT.pptx
SQL PPT.pptx
 
Getting started with my sql
Getting started with my sqlGetting started with my sql
Getting started with my sql
 
Database synchronization prashant parit
Database synchronization   prashant paritDatabase synchronization   prashant parit
Database synchronization prashant parit
 
My sql crashcourse_intro_kdl
My sql crashcourse_intro_kdlMy sql crashcourse_intro_kdl
My sql crashcourse_intro_kdl
 
Mysql
MysqlMysql
Mysql
 
Lovely
LovelyLovely
Lovely
 
Fudcon talk.ppt
Fudcon talk.pptFudcon talk.ppt
Fudcon talk.ppt
 
Mysql ppt
Mysql pptMysql ppt
Mysql ppt
 
The mysqlnd replication and load balancing plugin
The mysqlnd replication and load balancing pluginThe mysqlnd replication and load balancing plugin
The mysqlnd replication and load balancing plugin
 
Introduction to Mysql
Introduction to MysqlIntroduction to Mysql
Introduction to Mysql
 

Más de YUCHENG HU

Confluencewiki 使用空间
Confluencewiki 使用空间Confluencewiki 使用空间
Confluencewiki 使用空间YUCHENG HU
 
Presta shop 1.6 如何安装简体中文语言文件
Presta shop 1.6 如何安装简体中文语言文件Presta shop 1.6 如何安装简体中文语言文件
Presta shop 1.6 如何安装简体中文语言文件YUCHENG HU
 
Logback 介绍
Logback 介绍Logback 介绍
Logback 介绍YUCHENG HU
 
Presta shop 1.6 详细安装指南
Presta shop 1.6 详细安装指南Presta shop 1.6 详细安装指南
Presta shop 1.6 详细安装指南YUCHENG HU
 
Presta shop 1.6 的安装环境
Presta shop 1.6 的安装环境Presta shop 1.6 的安装环境
Presta shop 1.6 的安装环境YUCHENG HU
 
Presta shop 1.6 如何安装简体中文语言文件
Presta shop 1.6 如何安装简体中文语言文件Presta shop 1.6 如何安装简体中文语言文件
Presta shop 1.6 如何安装简体中文语言文件YUCHENG HU
 
Presta shop 1.6 图文安装教程
Presta shop 1.6 图文安装教程Presta shop 1.6 图文安装教程
Presta shop 1.6 图文安装教程YUCHENG HU
 
V tiger 5.4.0 图文安装教程
V tiger 5.4.0 图文安装教程V tiger 5.4.0 图文安装教程
V tiger 5.4.0 图文安装教程YUCHENG HU
 
Confluence 回顾(retrospectives) 蓝图 cwikiossez
Confluence 回顾(retrospectives) 蓝图   cwikiossezConfluence 回顾(retrospectives) 蓝图   cwikiossez
Confluence 回顾(retrospectives) 蓝图 cwikiossezYUCHENG HU
 
Confluence 会议记录(meeting notes)蓝图 cwikiossez
Confluence 会议记录(meeting notes)蓝图   cwikiossezConfluence 会议记录(meeting notes)蓝图   cwikiossez
Confluence 会议记录(meeting notes)蓝图 cwikiossezYUCHENG HU
 
VTIGER - 销售机会 - CWIKIOSSEZ
VTIGER - 销售机会 - CWIKIOSSEZ VTIGER - 销售机会 - CWIKIOSSEZ
VTIGER - 销售机会 - CWIKIOSSEZ YUCHENG HU
 
Confluence 使用一个模板新建一个页面 cwikiossez
Confluence 使用一个模板新建一个页面     cwikiossezConfluence 使用一个模板新建一个页面     cwikiossez
Confluence 使用一个模板新建一个页面 cwikiossezYUCHENG HU
 
Confluence 使用模板
Confluence 使用模板Confluence 使用模板
Confluence 使用模板YUCHENG HU
 
Cwikiossez confluence 订阅页面更新邮件通知
Cwikiossez confluence 订阅页面更新邮件通知Cwikiossez confluence 订阅页面更新邮件通知
Cwikiossez confluence 订阅页面更新邮件通知YUCHENG HU
 
Cwikiossez confluence 关注页面 博客页面和空间
Cwikiossez confluence 关注页面 博客页面和空间Cwikiossez confluence 关注页面 博客页面和空间
Cwikiossez confluence 关注页面 博客页面和空间YUCHENG HU
 
My sql would you like transactions
My sql would you like transactionsMy sql would you like transactions
My sql would you like transactionsYUCHENG HU
 
MySQL 简要介绍
MySQL 简要介绍MySQL 简要介绍
MySQL 简要介绍YUCHENG HU
 
mysql 5.5.25 用户安装备忘
mysql 5.5.25 用户安装备忘mysql 5.5.25 用户安装备忘
mysql 5.5.25 用户安装备忘YUCHENG HU
 

Más de YUCHENG HU (20)

Confluencewiki 使用空间
Confluencewiki 使用空间Confluencewiki 使用空间
Confluencewiki 使用空间
 
Git
GitGit
Git
 
Presta shop 1.6 如何安装简体中文语言文件
Presta shop 1.6 如何安装简体中文语言文件Presta shop 1.6 如何安装简体中文语言文件
Presta shop 1.6 如何安装简体中文语言文件
 
Logback 介绍
Logback 介绍Logback 介绍
Logback 介绍
 
Presta shop 1.6 详细安装指南
Presta shop 1.6 详细安装指南Presta shop 1.6 详细安装指南
Presta shop 1.6 详细安装指南
 
Presta shop 1.6 的安装环境
Presta shop 1.6 的安装环境Presta shop 1.6 的安装环境
Presta shop 1.6 的安装环境
 
Presta shop 1.6 如何安装简体中文语言文件
Presta shop 1.6 如何安装简体中文语言文件Presta shop 1.6 如何安装简体中文语言文件
Presta shop 1.6 如何安装简体中文语言文件
 
Presta shop 1.6 图文安装教程
Presta shop 1.6 图文安装教程Presta shop 1.6 图文安装教程
Presta shop 1.6 图文安装教程
 
V tiger 5.4.0 图文安装教程
V tiger 5.4.0 图文安装教程V tiger 5.4.0 图文安装教程
V tiger 5.4.0 图文安装教程
 
Confluence 回顾(retrospectives) 蓝图 cwikiossez
Confluence 回顾(retrospectives) 蓝图   cwikiossezConfluence 回顾(retrospectives) 蓝图   cwikiossez
Confluence 回顾(retrospectives) 蓝图 cwikiossez
 
Confluence 会议记录(meeting notes)蓝图 cwikiossez
Confluence 会议记录(meeting notes)蓝图   cwikiossezConfluence 会议记录(meeting notes)蓝图   cwikiossez
Confluence 会议记录(meeting notes)蓝图 cwikiossez
 
VTIGER - 销售机会 - CWIKIOSSEZ
VTIGER - 销售机会 - CWIKIOSSEZ VTIGER - 销售机会 - CWIKIOSSEZ
VTIGER - 销售机会 - CWIKIOSSEZ
 
Confluence 使用一个模板新建一个页面 cwikiossez
Confluence 使用一个模板新建一个页面     cwikiossezConfluence 使用一个模板新建一个页面     cwikiossez
Confluence 使用一个模板新建一个页面 cwikiossez
 
Confluence 使用模板
Confluence 使用模板Confluence 使用模板
Confluence 使用模板
 
Cwikiossez confluence 订阅页面更新邮件通知
Cwikiossez confluence 订阅页面更新邮件通知Cwikiossez confluence 订阅页面更新邮件通知
Cwikiossez confluence 订阅页面更新邮件通知
 
Cwikiossez confluence 关注页面 博客页面和空间
Cwikiossez confluence 关注页面 博客页面和空间Cwikiossez confluence 关注页面 博客页面和空间
Cwikiossez confluence 关注页面 博客页面和空间
 
My sql would you like transactions
My sql would you like transactionsMy sql would you like transactions
My sql would you like transactions
 
MySQL 指南
MySQL 指南MySQL 指南
MySQL 指南
 
MySQL 简要介绍
MySQL 简要介绍MySQL 简要介绍
MySQL 简要介绍
 
mysql 5.5.25 用户安装备忘
mysql 5.5.25 用户安装备忘mysql 5.5.25 用户安装备忘
mysql 5.5.25 用户安装备忘
 

Último

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 

Último (20)

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 

My sql università di enna a.a. 2005-06

  • 2. Intro  MySQL® and the MySQL logo are registered trademarks of MySQL AB (a Swedish company)  The MySQL® software delivers a very fast, multi-threaded, multi- user, 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”
  • 3. 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  See http://www.mysql.com/company/legal/licensing/ for more information on our licensing policies.
  • 4. 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
  • 5. Operating Systems Supported by MySQL  It is possible to port MySQL to all modern systems that have a C++ compiler and a working implementation of POSIX threads  Thread support is needed for the server. To compile only the client code, the only requirement is a C++ compiler  “We use and develop the software ourselves primarily on Linux (SuSE and Red Hat), FreeBSD, and Sun Solaris (Versions 8 and 9)”
  • 6. Operating Systems Supported by MySQL  MySQL has been reported to compile successfully on the following operating systems:  AIX 4.x, 5.x  Amiga  BSDI 2.x  Digital Unix 4.x  FreeBSD 2.x, 3.x, 4.x  Mac OS X  Windows 9x, Me, NT, 2000, XP, and 2003
  • 7. Installing MySQL on Windows  A native Windows version of MySQL has been available from MySQL AB since version 3.21 and represents a sizable percentage of the daily downloads of MySQL  The installer for the Windows version of MySQL 5.0, combined with a GUI Configuration Wizard, automatically installs MySQL, creates an option file, starts the server, and secures the default user accounts
  • 8. Installing MySQL on Windows  MySQL 5.0 for Windows is available in three distribution formats:  The binary distribution contains a setup program that installs everything you need so that you can start the server immediately  The source distribution contains all the code and support files for building the executables using the Visual Studio 2003 compiler system  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
  • 9. Installing MySQL on Windows  A copy of the MySQL binary distribution for Windows, which can be downloaded from http://dev.mysql.com/downloads/  You may also have the following optional requirements: 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
  • 10.  For MySQL 5.0, there are three installation packages to choose from when installing MySQL on Windows. The packages are as follows:  Essential package  Complete package  Noinstall archive  The Essentials package is recommended for most users Installing MySQL on Windows
  • 11.  The following entries are created within the new Start menu section: MySQL Command Line Client : This is a shortcut to the mysql command-line client and is configured to connect as the root user. The shortcut prompts for a root user password when connecting MySQL Server Instance Config Wizard : This is a shortcut to the MySQL Configuration Wizard. Use this shortcut to configure a newly installed server, or to re- configure an existing server MySQL Documentation : This is a link to the MySQL server documentation that is stored locally in the MySQL server installation directory. This option is not available when the MySQL server is installed using the Essentials installation package. Installing MySQL on Windows
  • 12. The Main Features of MySQL Written in C and C++ Tested with a broad range of different compilers Works on many different platforms Uses GNU Automake, Autoconf, and Libtool for portability APIs for C, C++, Eiffel, Java, Perl, PHP, Python, Ruby, and Tcl are available …
  • 13. 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  Fixed-length and variable-length records
  • 14. Statements and Functions  Full operator and function support in the SELECT and WHERE clauses of queries.  Full support for SQL GROUP BY and ORDER BY clauses. Support for group functions (COUNT(), COUNT(DISTINCT ...), AVG(), STD(), SUM(), MAX(), MIN()  Support for LEFT OUTER JOIN and RIGHT OUTER JOIN  Support for aliases on tables and columns as required by standard SQL
  • 15. Statements and Functions (2)  DELETE, INSERT, REPLACE, and UPDATE return the number of rows that were changed (affected)  The MySQL-specific SHOW command can be used to retrieve information about databases, database engines, 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  You can mix tables from different databases in the same query
  • 16. 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 …”
  • 17. 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
  • 18. How Big MySQL Tables Can Be  MySQL 3.22 had a 4GB (4 gigabyte) limit on table size.  With the MyISAM storage engine in MySQL 3.23, the maximum table size was increased to 65536 terabytes (2567 – 1 bytes).  With this larger allowed table size, the maximum effective table size for MySQL databases is usually determined by operating system constraints on file sizes, not by MySQL internal limits
  • 19.  The following table lists some examples of operating system file-size limits. This is only a rough guide and is not intended to be definitive  Win32 (FAT/FAT32) 2GB/4GB  Win32 (NTFS) 2TB  Linux 2.2-Intel 2GB  Linux 2.4+ (ext3) 4TB  Windows users please note: FAT and VFAT (FAT32) are not considered suitable for production use with MySQL. Use NTFS instead How Big MySQL Tables Can Be
  • 20. Connecting to and Disconnecting from the Server  To connect to the server, you will usually need to provide a MySQL username when you invoke mysql and, most likely, a password. If the server runs on a machine other than the one where you log in, you will also need to specify a hostname  shell> mysql -h host -u user –p Enter password: ********
  • 21. Connecting to and Disconnecting from the Server  shell> mysql -h host -u user –p Enter password: ********  host and user represent the hostname where your MySQL server is running and the username of your MySQL account  The ******** represents your password; enter it when mysql displays the Enter password: prompt.
  • 22. Connecting to and Disconnecting from the Server
  • 23. Connecting to and Disconnecting from the Server  Some MySQL installations allow users to connect as the anonymous (unnamed) user to the server running on the local host.  If this is the case on your machine, you should be able to connect to that server by invoking mysql without any options:  shell> mysql
  • 24. Connecting to and Disconnecting from the Server  After you have connected successfully, you can disconnect any time by typing QUIT (or EXIT) at the mysql > prompt:  shell> QUIT Bye  shell> EXIT Bye  On Unix, you can also disconnect by pressing Control-D
  • 25. Entering Queries  mysql> SELECT VERSION( ), CURRENT_DATE;
  • 26. Notes • 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.
  • 27. 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.
  • 28. 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
  • 29. 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;
  • 30. • Here's another query. It demonstrates that you can use mysql as a simple calculator Entering Queries
  • 31.  You can even enter multiple statements on a single line. Just end each one with a semicolon Entering Queries
  • 32.  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
  • 34.  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
  • 35.  "> Waiting for next line, waiting for completion of a string that began with a double quote (‘"’)  `> Waiting for next line, waiting for completion of an identifier that began with a backtick (‘`’)  /*> Waiting for next line, waiting for completion of a comment that began with /* Entering Queries
  • 37. Entering Queries  mysql> SELECT * FROM my_table WHERE name = 'Smith AND age < 30;  '>
  • 38. Creating and Using a Database This section shows you how to: Create a database Create a table Load data into the table Retrieve data from the table in various ways Use multiple tables
  • 39.  Use the SHOW statement to find out what databases currently exist on the server Creating and Using a Database
  • 40.  If the test database exists, try to access it Creating and Using a Database
  • 41. USE USE, like QUIT, does not require a semicolon You can terminate such statements with a semicolon if you like; it does no harm It must be given on a single line Creating and Using a Database
  • 42. Creating and Selecting a Database  If the administrator creates your database for you when setting up your permissions, you can begin using it. Otherwise, you need to create it yourself
  • 44. Creating a Table  Creating the database is the easy part, but at this point it's empty, as SHOW TABLES tells you:
  • 45. Creating a Table  Creating the database is the easy part, but at this point it's empty, as SHOW TABLES tells you:
  • 46. Creating a Table Create table slides (id integer, contents varchar(30), images char);
  • 47. Creating a Table mysql> show tables;
  • 48. Creating a Table mysql> describe slides;
  • 49. Loading Data into a Table  After creating your table, you need to populate it. The LOAD DATA statement is useful for this  Because you are beginning with an empty table, an easy way to populate it is to create a text file containing a row for each of your slide, then load the contents of the file into the table with a single statement
  • 50. Loading Data into a Table
  • 51. Loading Data into a Table mysql> LOAD DATA LOCAL INFILE - > 'C:Documents and SettingsUserDocumentiDidatticaceriMysqldati ‘ > slides.txt' INTO TABLE slides;
  • 52. Loading Data into a Table mysql> LOAD DATA LOCAL INFILE - > 'C:Documents and SettingsUserDocumentiDidatticaceriMysqldati ‘ > slides.txt' INTO TABLE slides;
  • 53. Retrieving Information from a Table mysql> select * from slides;
  • 54. mysql> select contents from slides; Retrieving Information from a Table
  • 55. mysql> delete from slides; Retrieving Information from a Table
  • 56. mysql> select * from slides; Retrieving Information from a Table