T Index tables (continued) definition extensions, 147–150 flushing, 63 implementing cache, 424–427 lock priority, 129 locking, 336, 338–341 maintenance extensions, 150–156 Maria configuration, 398–400 MERGE, 510–513 MySQL deviations, 106 mysqlslap, 551–552 partitioning. See partitioning privileges, 482 query analysis. See query analysis scans vs. indexes, 222 server maintenance extensions, 130–131 setting characters sets and collation, 101 SHOW commands, 146–147 SHOW CREATE commands, 138 SQL mode definitions, 206–207 SQL modes, 210–211 system, 476–478 types, 375 views. See MySQL views tablespaces Falcon, 408–409 InnoDB, 384–394 target hosts, 467 temporary tables optimizing away Using temporary, 620–623 profiling, 577 on triggers, 247–248 TEMPTABLE, 310 terminators, 88–89 test modes, SysBench CPU, 554 I/O, 555–557 memory, 559–561 mutex, 557–559 OLTP, 561–565 test servers, 443 testing functions, 789–792 ideas, 620 TEXT data types defined, 160–161 functions, 806–810 indexing, 226–227 sizes, 164 text files creating from database table, 126–127 LOAD DATA INFILE, 122–123 thawing, 406 third-party packages MySQL Proxy, 750–751 problems with, 11 threads flushing, 63 profiling, 578 replication and, 524 –529 server maintenance extensions, 130 slave promotion and, 730–731 test mode, 560–561 time event scheduling, 289–290 functions, 797–806 start and end times for periodic events, 293–294 TIME type, 183–184 time zones datetime types, 183, 192–193 language structure, 97–98 TIMESTAMP data type, 183–192 TINYINT(1), 180–183 TINYTEXT, 164 tokens keyword, 774–782 Lua, 760–763 proxy, 772–774 tools for accessing MySQL. See accessing MySQL backup, 445–446 benchmarking. See be nchmarking correcting data drift, 540–543 monitoring. See monitoring systems MySQL Proxy. See MySQL Proxy query analysis. See query analysis query optimization. See query optimization TRADITIONAL, 211 training, 820 Transactional database only, 33 transactions ACID compliance, 320–322 Falcon parameters, 404, 406 FEDERATED table limitations, 417 InnoDB support, 384 isolation levels, 325–335 locking and deadlocks, 336–343 Maria support for, 371 MySQL deviations, 110–111 overview, 319–320 PBXT configuration, 411–412 recovering, 343–344 statement extensions, 156–158 852 Index U statements, 322–325 storage engine support, 377 summary, 344–345 transform functions, 108 transliterations, 108 transparent partitioning, 513–514 TRIGGERS, 685–686 triggers caching with, 427 changing, 246–247 creating, 243–244 data security using, 664–665 dropping, 244–245 finding all, 252 multiple SQL statements in, 245–246 overview, 242–243 replication and limitations, 254–255 runtime behavior, 248–252 SHOW commands, 147 SHOW CREATE commands, 138 storage and backup, 252–254 stored routines, events and, 241–242 summary, 300 using cursors, 287 –289 on views and temporary tables, 247–248 troubleshooting foreign key constraints, 235–237 MySQL server, 47–48 TRUE,95 truncation error handling, 275–281 stored routine warning, 257–259 TRUNCATE, 120 tuning MySQL servers. See MySQL server tuning tuning query caches, 429–433 tunneling, ssh. See ssh tunneling type, 596–606 types, data. See data types types, index. See index types Typical installation, 21–22 U \u (use),57 UDFs (user-defined functions), 241–242 UFS (Unix file system), 355 undo logs, 343–344 UNION EXPLAIN and, 591–592 MERGE tables, 512–513 ORDER BY, 127 table definition extensions, 150 unique index values, 602–603 unique key constraints creating and dropping, 231–232 defined, 219–231 KEY_COLUMN_USAGE, 682–684 TABLE_CONSTRAINTS, 681–682 Unix case-sensitivity, 90–91 configuration file, 31 debugging account problems, 492 installing MySQL from archive package, 18–20 installing MySQL on, 13 –20 monitoring. See monitoring systems post-install configuration on, 36–39 resetting root password, 489–490 starting and stopping MySQL on System-V based, 42–43 unlocking, 338–340 UNSIGNED, 178 UPDATE DML extensions, 120 EXPLAIN on, 614 foreign key constraints and, 234 invoking triggers, 242–243 upsert statements, 112–114 updating datetime types, 187–188 indexes, 223 keys and indexes, 220 memcached, 438 SERIALIZABLE isolation levels and, 334–335 view, 313–316 upgrading mysqld, 45 –47, 257 upsert statements DML extensions, 120 MySQL deviations, 112–114 use (\u),57 user management accounts, 478–487 debugging account problems, 490–494 learning about, 473–478 resetting root password, 487–490 summary, 494 USER_PRIVILEGES, 715–716 user-defined functions (UDFs), 241–242 user-defined types, 108 user-defined variables, 131–135 usernames command-line tool options, 50 managing. See user management wildcards and blank values in, 650 853 U Index users changing event, 299 changing stored routine, 264–265 changing trigger, 250–252 group meetings, 819 managing with SQL Administrator, 77 MySQL community, 6–7 privileges and privilege levels, 651–653 resources, 130 Security Options screen, 35–36 Using filesort, 618–620 Using temporary, 620–623 utf8 character set charsets and collations, 100 defined, 93 index length, 227 utilities, MyISAM, 380–381 V validation, 656–665 values assigning to user-defined variables, 131–135 BLOB, 169 coercibility, 811 COMMAND in PROCESSLIST, 699–700 data access strategy, 600–603 datetime types, 185–187 ENUM and SET data types, 198–200 enumerations, 195–197 EXPLAIN Extra, 609–611 key constraints. See key constraints mysqldumpslow, 583–584 NOT NULL. See NOT NULL NULL. See NULL partitioning algorithms, 496–497 STATE in PROCESSLIST, 701–709 stored routine SQL usage, 267–268 subquery for select_type, 611 type, 597 VARBINARY, 170 VARCHAR defined, 160–161 length, 163–164 sizing, 608 variable-length strings binary data types, 171 character string types, 160–161 national character string types, 166 variables benchmarking recommendations, 565–566 InnoDB configuration, 384–385 local in stored routines, 262–264 mysqladmin commands, 64 Performance Metrics and SHOW GLOBAL STATUS, 570–572 in server option file. See option files server status, 360–361 server system, 361 SET extension and user-defined, 131–135 setting characters sets and collation, 101–104 SHOW commands, 147 SQL modes, 201 system views, 710–711 vendor-supplied packages, 11 versions choosing MySQL, 11–12 command-line tool options, 53 end of life, 569 mysqladmin commands, 64 upgrading mysqld,45–47 vertical partitioning, 496 viewing events, 295 triggers, 252 VIEWS, 674–676 views EXPLAIN and, 591 INFORMATION_SCHEMA database system. See MySQL Data Dictionary MySQL. See MySQL views SHOW CREATE commands, 139 on triggers, 247–248 visitor count caching, 424–427 volume groups, 455–460 Volume Shadow Copy Service (Microsoft VSS), 460 W warm backups defined, 441 tools, 446 warnings creating events, 292 logging, 518 SHOW commands, 147 SQL modes, 201–203 stored routine, 257–259, 274 –275 trigger, 245 weekly backups, 444 WHERE optimizing by eliminating functions, 625–626 SHOW and, 136 854 Index Z WHILE, 283 Widenius, Michael, 4 wildcard characters in ACLs, 650 defined, 475–476 Windows case-sensitivity, 91 configuration file, 31 Configuration Wizard on, 31–36 connecting to non-Windows machine, 51–52 copying databases to backup, 467 installing MySQL on, 20–24 monitoring. See monitoring systems mysql commands, 57–58 PATH variable configuration, 42–44 resetting root password, 488–489 starting and stopping from as service, 26–29 starting and stopping from command line, 25–26 tuning, 352–357 upgrading mysqld,46–47 WITH CHECK OPTION simulating check constraints in views, 310–312 on views that reference other views, 312–313 Wizards Configuration, 31–36 installation, 20–24 Workbench, MySQL, 80–83 working sets, 350 wrapper tables, 383–384 wrappers, 450–451 wrappers, transaction, 320 write locks defined, 336–337 row-level, 341–342 table-level, 339–341 writes, profiling. See profiling X XFS, 355 XML (eXtensible Markup Language) functions, 812 LOAD XML INFILE, 123–124 Y yanking, 58 YEAR data type, 183–184 YEAR_MONTH data type, 193–194 Z Zenoss Core, 641–642 zero dates, 207–209 ZEROFILL, 179 ZFS, 355, 453–454 Zmanda, 466 855 Get the most out of the latest software and leading-edge technologies with a Wiley Bible—your one-stop reference. The books you read to succeed. Available wherever books are sold. 978-0-470-26017-3 978-0-470-25704-3 978-0-470-04030-0 978-0-470-37918-9 Wiley and the Wiley logo are registered trademarks of John Wiley & Sons, Inc. All other trademarks are the property of their respective owners. . accessing MySQL. See accessing MySQL backup, 445–446 benchmarking. See be nchmarking correcting data drift, 540–543 monitoring. See monitoring systems MySQL. 235–237 MySQL server, 47–48 TRUE,95 truncation error handling, 275–281 stored routine warning, 257–259 TRUNCATE, 120 tuning MySQL servers. See MySQL server