bgoug 2014: developing using mysql
DESCRIPTION
MySQL is a very widely used product. By a large range of users. And it has development and administration tools for all of them, no matter the skill level. Or their interaction preferences. Or the operating system they prefer. If you are a vi/emacs/commnadline veteran MySQL has tools for you. If you are a glued to your mouse wizard with taste for modern day GUIs MySQL has tools for you. Even if that's your first encounter with MySQL, we have tools for you too. These tools will help you : - develop your database - enter data into it - retrieve data out of it - administer it We will go through an overview of all the MySQL related tools Oracle offers. It's an introductory session.TRANSCRIPT
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Developing using MySQLOverview of the administration and development GUI tools and utilities
Georgi KodinovTeam Lead, MySQL SrvGen Team
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 2
Program Agenda
1
2
3
4
5
MySQL Workbench
MySQL Enterprise Monitor
Visual Studio Integration
Command line
3d party tools
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 3
MySQL WorkbenchThe developer’s and DBA’s Swiss army knife
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 4
MySQL Workbench is a unified visual tool for database architects, developers, and DBAs
– MySQL Workbench product home page
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 5
MySQL WorkbenchWhat can it do for you ?
Design• ER models• Reverse engineer• Track changes• Document• Validate designs
Develop• SQL Editor• Row and file exec• Auto-complete• Object browser• Migrate into MySQL• Visual EXPLAIN• Live results pane
Administer• View server health• Administer security• Configure the server• Handle auditing• Backup and recovery
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 6
MySQL Workbench: The Server Status Screen
Your toolbox. Available
everywhere.
Context sensitive information and
properties
Your server’s health at a glance
All the important configuration data
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 7
MySQL Workbench: Administration Dashboard
Context sensitive information and
properties
Live dashboard of all the Server’s important
“Vital Signs”
Your toolbox. Available
everywhere.
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 8
MySQL Workbench: The Editor
Context sensitive information and
properties
Context Sensitive Help
Your toolbox. Available
everywhere.
Object browser
Execution status
Editor window
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 9
MySQL Workbench: The editor (Visual Explain)
Context sensitive information and
properties
Your toolbox. Available
everywhere.
Visual Explain
Execution status
Editor window
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 10
MySQL WorkbenchWhat else ?
• Fully scriptable• Import from DBDesigner• Export model diagrams• Cross platform (Linux, MS Windows and MacOSX)• Can edit data in a grid view• Can preserve SQL snippets for reuse• Integrates PERFORMANCE_SCHEMA and the SYS views
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 11
MySQL WorkbenchEditions
Community Standard: adds Enterprise: adds
Scripting Schema and model validation MySQL Enterprise Backup GUI
SQL editor/execution Database documentation MySQL Enterprise Audit GUI
Server admin
Performance and tuning
User and session management
Connection management
Object management
Data management
Visual data modeling
Reverse engineering
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 12
MySQL Enterprise MonitorAll a serious DBA needs. And more !
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 13
MySQL Enterprise Monitor provides real-time visibility into the performance and availability of all your MySQL databases.– MySQL Enterprise Monitor product home page
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 14
MySQL Enterprise Manager: Architecture• MySQL
• Provides MySQL related metrics
• MySQL Query Analyzer collects data using PERFORMANCE_SCHEMA
• Service Manager• Collects all MySQL related metrics from MySQL or agents
• Collects all Host/OS related metrics from agents
• Repository• Stores historical MySQL performance data
• Agent (optional)• Only for Host/OS metrics
• Not required for DB metrics
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 15
MySQL Enterprise Monitor: What is it good for ?• Monitor large sites with multiple MySQL servers• Agentless remote monitoring in the Cloud• Monitor all aspects of your dedicated database server• Intelligent alerts• Identify security vulnerabilities• Drill down on problematic queries• Monitor replication and backup• Monitor MySQL Cluster
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 16
MySQL Enterprise Monitor: The DashboardSLA monitoring
Real-time performance monitoring
Alerts and notifications.
MySQL Best Practices
advisors
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 17
MySQL Enterprise Monitor: The Query Analyzer
Real-time query performance
Visual correlation
graphs
Find and fix expensive
queries
Detailed query statistics
Query response time index
(QRTi)
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 18
MySQL Query Analyzer: Beautiful Reports and Graphs
Memory Usage InnoDB Monitoring InnoDB buffer pool
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 19
MySQL for Visual StudioFor the visual developer
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 20
MySQL for Visual Studio provides access to MySQL objects and data without forcing your developers to leave Visual Studio– http://www.mysql.com/why-mysql/windows/visualstudio/
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 21
MySQL for Visual Studio: what can it do for you ?
Design• Tables• Indexes• Views• Stored procedures• Triggers• Model designers
Develop• Query Designer• Syntax highlighting• Contextual help• Code generation• Code templates
Debug• Debug stored
routines inside the IDE.• Get local variables etc.
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 22
Disclaimer: I’m using a weird Visual Studio Setup !The screenshots you’re about to see are not that polished !
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 23
MySQL For Visual Studio: It all starts with a login
Go here if you need to enter a
port
Go to “Server Explorer” and
hit “Add Connection” button to get
this
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 24
MySQL For Visual Studio: The MySQL Script EditorFile -> New ->
MySQL -> MySQL Script
Has its own login details !
Syntax highlighting !
Can see both results and messages
Data are editable too.
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 25
MySQL For Visual Studio: The VS Query Designer
Right click the connection and
pick “New Query”
to get this
The extremely well known
query designer
An SQL view
You can edit data too
Server explorer for the MySQL
connection
You get the rest too !
Properties panefor a MySQL
column
The “Execute” button
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 26
MySQL For Visual Studio: The Table EditorDouble-click on
a table in “Server
Explorer” to get here
Or add a new table
Pretty standard
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 27
MySQL For Visual Studio: Views are Editable Too
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 28
MySQL For Visual Studio: Debugging Stored Procedures
Right-click a stored
procedure and pick “Debug”
Standard debug toolbar !
Standard current
executed line
You can set breakpoints too
Call-stackLocals
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 29
Command LineFor the old-fashioned DBA and developer
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 30
Command line tools: All important ones at a glanceTool Primary Usemysql Execute individual commands and script filesmysqladmin Start/stop the server, misc. administrative commandsmysql_upgrade Live upgrade of a server instancemysqldump Dump database objects into script filesmysql_config_editor Manipulate stored login pathsmysqlbinlog Process binary log filesmysqlslap Simple benchmark tool
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 31
Command line tools: the rest• Convenience tools–mysqlcheck, mysqlimport, mysqlshow, mysqlaccess, mysql_install_db,
mysql_secure_installation, mysqld_safe, mysqld_multi etc.
• Low level repair tools–myisamchk, myisamlog, myisampack, myisam_ftdump, innodbchecksum
• Development and compilation tools–mysql_config, my_print_defaults, resolve_stack_dump, perror, replace, resolveip,
comperr, mysql_tzinfo_to_sql
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 32
Command line tools: MySQL Utilities• Automate frequent operations– E.g. replication setups and operations, copy a database, create users etc.
• Written in python• Integrated into Workbench• Give it a try !
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 33
3d Party ToolsSomething for every taste
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 34
3d Party Tools: The ones I’ve heard about• phpMyAdmin: PHP based admin interface• Percona tools: various administration and development tools• Mysql Sandbox• Random Query Generator
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 35
Questions And Answers
Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Safe Harbor StatementThe preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
36