MySQL
From Wikibooks, the open-content textbooks collection
[edit] Synopsis
MySQL is a free, widely used SQL engine. It can be used as a fast database as well as a rock-solid SGDB using a modular engine architecture.
The purpose of this wikibook is to provide a practical knowledge on using the database from two points of view:
- application developer: learn about SQL basics, phpMyAdmin, query optimization
- system administrator: learn about installation, security, maintenance, failover, high availability
Best of all, this book is freely available for everybody to use and share, under the GNU Free Documentation License.
[edit] Contents
This is the table of contents, with the current progress. Click on a chapter title to go to its separate page.
[edit] Introduction
[edit] MySQL Practical Guide
[edit] Language
The basic SQL commands
- Browsing the databases
- Specifying table names
- Definitions
- User Variables
- Alias
- Queries
- Data manipulation
- Table manipulation
- Using/Dealing with NULL
- Reserved Words
- Data Types
- Operators
- Import / export
- Functions
- Exercises
- Pivot table or a crosstab report
[edit] Table types
- MyISAM and InnoDB
- Merge Table
- MEMORY / HEAP
- BDB
- BLACKHOLE
- Miscellaneous
[edit] Comparison
- With other databases
- With SQL92
- Writing portable, non-MySQL-specific code
[edit] Administration
- Installation
- Start the service
- Configuration
- Privileges
- Processes
- Security
- Backup
- Logs
- Admin Tools
[edit] Databases manipulation
- Creation
- Deletion
- Rename
- Copy
- Migration from other databases
- Tools for data modeling
[edit] Optimization
- KEY/INDEX, EXPLAIN, ANALYZE TABLE table, BENCHMARK(count, expression), difference between KEY and PRIMARY KEY
[edit] Stored Programs
- Triggers
- Events
- Stored Procedures
- Procedural extensions to SQL
[edit] Maintenance and evolution
- ALTER TABLE, CREATE INDEX
- tricks: IF NOT EXIST...
- Software:
- mysql -f (cf. tikiwiki's forgiving 1.10 update procedure)
- Savane's migration scripts, in the update/version directory
- Charsets: what are Latin1 and UTF-8? How to cleanly convert a database from Latin1 to UTF-8 (not just mysqldump|iconv, also ALTER TABLE table MODIFY col VARCHAR(100) CHARACTER SET utf8 + SET NAMES 'utf8' in PHP), phpMyAdmin bugs (need to add SET NAMES utf8 in some circumstances)
[edit] APIs
- Security
- Optimization
- PHP
[edit] Appendixes
- CheatSheet
- About this book
- History?
- Contributors
[edit] License
[edit] Suggestions
Case study: I was suggested to use SPIP (a system to manage articles and news) for a sample study. Mediawiki might be interesting as well :)
Add a list of CLIENTS to use with MYSQL, I dont know of any good ones, MYSQL GUI ones are ok, but I need some others
[edit] Links
[edit] Related wikibooks
- SQL: about general SQL programming, with lots of exercises.
- Programming:Converting_MySQL_to_PostgreSQL: highlights the differences between the two database servers
- Lucid Dreaming - model for wikibook layout ;)
[edit] Compatible sources
The following sources are released under the GFDL and hence good candidates for inclusion in the wikibook, as well as joint writing efforts:
- #mysql wiki
- PostgreSQL Documentation: the documentation is released under the mBSD license, which is compatible with the GFDL. It includes generic material about SQL.
[edit] External
- MySQL has a great used commented documentation on their website - but it's completely non-free.
- GNU support
- How to reset MySQL Password
- Repair MySQL Database
- MySQL Tutorial with Practical Examples