Professional Documents
Culture Documents
MySQL - Crash Course (PDFDrive)
MySQL - Crash Course (PDFDrive)
https://wikis.oracle.com/pages/viewpage.action?pageId=27394602
http://www.mysql.com/news-and-events/sun-to-acquire-mysql.html
Fast
Agile
Ease of use
Scalable
Enterprise Ready
• MySQL Database
• MySQL Database 5.5 5.6
• MySQL Enterprise Backup 3.5 • MySQL Cluster 7.2
• MySQL Enterprise Monitor 2.3 DMR*
• MySQL Cluster Manager 1.1 and MySQL Labs!
All GA!
(“early and often”)
• MySQL Workbench 5.2
GA!
•MySQL Enterprise Monitor 2.2
•MySQL Cluster 7.1
• MySQL Cluster Manager 1.0
A Better MySQL
All GA!
http://www.oracle.com/technetwork/issue-archive/2011/11-jan/index-191276.html
Rely on MySQL
• A high-level overview
Error Log
– log-error
Binary Log
– Log-bin custom set via my.cnf
Slow Query Log
– Log-slow-queries
– Slow-query-time
– log-queries-not-using-indexes
General Log
– Log
http://dev.mysql.com/doc/refman/5.5/en/server-logs.html
http://carlos.syr.edu/oracle-database-architecture/
Standalone (mysqld)
UNIX daemon
Windows service
Regular process on UNIX or Windows
Embedded (libmysqld)
Shared / Dynamic library
http://dev.mysql.com/doc/refman/5.1/en/partitioning-overview.html
http://dev.mysql.com/tech-resources/articles/mysql_55_partitioning.html
Replication formats:
Statement-based replication (SBR): propagate
SQL statements
Row-based replication (RBR): propagate row
changes
Mixed-based replication: SBR or RBR depending
on the query
http://sqlhjalp.com/pdf/2012_Scale_Replication.pdf
Replication Threads
Binlog dump thread
Slave I/O thread
Slave SQL thread
Replication Files
relay log
master info log
relay log info log
http://sqlhjalp.com/pdf/2012_Scale_Replication.pdf
http://sqlhjalp.com/pdf/2012_Scale_Replication.pdf
http://sqlhjalp.com/pdf/2012_Scale_Replication.pdf
http://www.mysql.com/products/cluster/
http://www.mysql.com/products/cluster/
Possible solutions:
Replication?
mysqldump
MySQL Enterprise Backup
http://www.amazon.com/Effective-MySQL-Backup-Recovery-Oracle/dp/0071788573
The backup program does NOT make a backup of the .frm files of the tables,
and it does not make backups of MyISAM tables. To back up these items, either:
- Make backups of the .frm files with the Unix 'tar' or the Windows WinZip or an equivalent tool both BEFORE and
AFTER ibbackup finishes its work,and also store the MySQL binlog segment that is generated between the
moment
you copy the .frm files to a backup and the moment ibbackup finishes its work.
For extra safety, also use:
mysqldump -l -d yourdatabasename
to dump the table CREATE statements in a human-readable form before
ibbackup finishes its work.
User: username@hostname
Precisely: ‘user-name-mask’@’host-name-mask’
Host name – client host name (“from” host name)
User name mask:
can be empty (anonymous user) – all users
Host name mask:
can be empty – all host names (%)
can have ‘%’ (e.g.: %.foo.com)
$ mysql -u root -p
Enter password:
http://dev.mysql.com/doc/refman/5.5/en/resetting-permissions.html
http://dev.mysql.com/doc/refman/5.6/en/grant.html
http://dev.mysql.com/doc/refman/5.6/en/grant.html
http://dev.mysql.com/doc/refman/5.6/en/show.html
http://dev.mysql.com/doc/refman/5.5/en/data-types.html
http://dev.mysql.com/doc/refman/5.5/en/data-types.html
http://dev.mysql.com/doc/refman/5.5/en/data-types.html
ENUM ( ) Short for ENUMERATION which means that each column may
have one of a specified possible values.
SET Similar to ENUM except each column may have more than one of the
specified possible values.
…..
`transfer_method` enum('OFF','EMAIL','FTP','BATCH POST','FTP-SSL','REAL
TIME POST','CUSTOM') default NULL,
….
http://dev.mysql.com/doc/refman/5.5/en/data-types.html
http://dev.mysql.com/doc/refman/5.5/en/explain.html
http://effectivemysql.com/downloads/ExplainingTheMySQLEXPLAIN-OOW-2011.pdf
http://prajwal-tuladhar.net.np/2009/09/26/481/know-more-about-mysql-explain/
http://www.slideshare.net/ligaya/explain
http://dev.mysql.com/doc/refman/5.5/en/stored-routines.html
http://dev.mysql.com/doc/refman/5.5/en/create-trigger.html
mysql> INSERT INTO test4 (a4) VALUES (0), (0), (0), (0), (0), (0), (0), (0), (0), (0);
Query OK, 10 rows affected (0.01 sec)
Records: 10 Duplicates: 0 Warnings: 0
INSERT INTO test1 VALUES (1), (3), (1), (7), (1), (8), (4), (4);
Query OK, 8 rows affected (0.01 sec)
Records: 8 Duplicates: 0 Warnings: 0
## Warnings: 1
Statement is unsafe because it invokes a trigger or a stored function that inserts into an
AUTO_INCREMENT column. Inserted values cannot be logged correctly.
set BINLOG_FORMAT = MIXED;
http://dev.mysql.com/doc/refman/5.5/en/create-trigger.html
http://dev.mysql.com/doc/refman/5.5/en/create-trigger.html
http://dev.mysql.com/doc/refman/5.5/en/commit.html
START TRANSACTION;
SELECT @A:=SUM(salary) FROM table1 WHERE type=1;
UPDATE table2 SET summary=@A WHERE type=1;
COMMIT;
http://dev.mysql.com/doc/refman/5.5/en/commit.html
• MySQL Editions
MySQL Enterprise
High Availability MySQL Workbench
dev.mysql.com
Downloads: http://dev.mysql.com/downloads/
Documentation: http://dev.mysql.com/doc/
Forums: http://forums.mysql.com/
PlanetMySQL: http://planet.mysql.com
List of resources (books) : http://dev.mysql.com/resources/
MySQL Resources
eDelivery.com
Download and evaluate all MySQL products
Wiki:
https://wikis.oracle.com/display/mysql/Home
http://forge.mysql.com/wiki/Main_Page – Older Not used as much --
http://1.bp.blogspot.com/-WmD-
U4CwYwc/TwJIc4qp_hI/AAAAAAAAADY/Bj2_8cQFXOw/s1600/First_things_first_.jpg
http://www.techcn.com.cn/index.php?doc-view-131262.html
http://jeremylq.files.wordpress.com/2008/10/davidaxmark-larrysyacht-2005-08-15-l.jpg
http://blogs.oracle.com/barton808/entry/mysql_conf08_marten_mickos_tells
http://www.bytebot.net/blog/archives/2008/04/14/mysql-community-dinner-a-great-success
http://www.fayerwayer.com/2010/05/larry-ellison-critica-fuertemente-a-jonathan-schwartz/
http://www.devside.net/server/webdeveloper
http://www.curtoons.com/superman-logo/
http://systems.takizo.com/2009/08/23/how-to-remove-mysql-binary-log/
http://carlos.syr.edu/oracle-database-architecture/
http://images-4.findicons.com/files/icons/977/rrze/720/database_mysql.png
http://bhaveshvala.wordpress.com/2009/09/15/mysqls-blackhole-storage-engine/
http://www.erm.ecs.soton.ac.uk/theme3/managing_your_references.html
keith.larson@oracle.com
http://sqlhjalp.com/pdf/MySQL_crashcourse_2012.pdf