MySQL open database connectivity: esempi in PHP e C/C++
Massimo Petrillo - massimo.petrillo@cirass.unina.it
Fonte: www.mysql.com
- “The world's most popular open source database”
- “Extremely fast and easy to customize”
- “Unmatched in speed, compactness, stability and ease of deployment”
- “Strict transaction control or with ultra-fast transactionless disk access”
Features (1/2)
- ANSI SQL 99 syntax support
- Cross-platform support: Linux, Microsoft Windows, FreeBSD, Sun Solaris, IBM's AIX, Mac OS X, HP-UX, AIX, QNX, Novell NetWare, SCO OpenUnix, SGI Irix, and Dec OSF
- Independent storage engines
- InnoDB (row-level locking and transaction support)
- MyISAM (maximum performance)
- Transactions
- Flexible security system, including SSL support
- Query caching
Features (2/2)
- Replication: many "slave" - single "master" server for robustness and speed
- Full-text indexing and searching
- Full-text indexes allow you to search fields containing arbitrary text for specific words and phrases, including relevance rankings
- Embedded database library
- You can include the full power of the MySQL database server into applications and electronic devices
Upcoming features
…In pratica ciò che manca:
- Character set handling, with full Unicode support
- Expanded support for subqueries
- GIS (Geometrical data)
- Multi-master replication
- Stored procedures and triggers
- Views
Installazione ed avvio in Windows
- Decomprimere il file zippato in una cartella temporanea
- Eseguire setup.exe
- A questo punto il tutto viene scritto in c:\mysql
- Se il sistema operativo è Win95/98/ME, lanciare c:\mysql\mysqld.exe
- Se il sistema operativo è WinNT/2K/XP, lanciare c:\mysql\mysqld-max-nt.exe
- Avviare il servizio in “gestione computer”
- TEST: lanciare c:\mysql\bin\mysql
Modalità di utilizzo
Architettura client/server
- “Terminal monitor'' interattiva e batch
- Programmi applicativi (per mezzo di API)
NB: Sulla macchina server deve essere in esecuzione il processo server “mysqld”
Terminal monitor (1/…)
mysql
USO: [OPTIONS] [database]
Principali opzioni:
- -u nome utente
- -p password
- Acceso a server -h host su altri host
Terminal monitor (2/…)
MySQL control center
Application Programming Interface
Contributed APIs:
- Official APIs: Perl
- C
- Ruby
- Python
- ODBC
- .NET
- JAVA
- Ma anche PHP
- C++
- TCL/TK
- …e tanti altri
MySQL vs C
Strutture dati connessioni
- MYSQL risultati
- MYSQL_RES riga del risultato
- MYSQL_ROW info sui campi
- MYSQL_FIELD Connessione
MYSQL *mysql_init(MY
Scarica il documento per vederlo tutto.
Scarica il documento per vederlo tutto.
Scarica il documento per vederlo tutto.
Scarica il documento per vederlo tutto.
Scarica il documento per vederlo tutto.
Scarica il documento per vederlo tutto.