More Related Content Similar to BGOUG 2014: Developing Using MySQL (20) More from Georgi Kodinov (20) BGOUG 2014: Developing Using MySQL1. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Developing using MySQL
Overview of the administration and development GUI tools and
utilities
Georgi Kodinov
Team Lead, MySQL SrvGen Team
2. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Program Agenda
1
2
3
4
5
MySQL Workbench
MySQL Enterprise Monitor
Visual Studio Integration
Command line
3d party tools
2
3. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL Workbench
The developer’s and DBA’s Swiss army knife
3
4. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL Workbench is a unified visual
tool for database architects,
developers, and DBAs
– MySQL Workbench product home page
4
5. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL Workbench
What can it do for you ?
5
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
6. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL Workbench: The Server Status Screen
6
Your toolbox.
Available
everywhere.
Context sensitive
information and
properties
Your server’s health
at a glance
All the important
configuration data
7. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL Workbench: Administration Dashboard
7
Context sensitive
information and
properties
Live dashboard of
all the Server’s
important
“Vital Signs”
Your toolbox.
Available
everywhere.
8. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL Workbench: The Editor
8
Context sensitive
information and
properties
Context Sensitive
Help
Your toolbox.
Available
everywhere.
Object browser
Execution status
Editor window
9. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL Workbench: The editor (Visual Explain)
9
Context sensitive
information and
properties
Your toolbox.
Available
everywhere.
Visual Explain
Execution status
Editor window
10. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL Workbench
What 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
10
11. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL Workbench
Editions
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
11
12. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL Enterprise Monitor
All a serious DBA needs. And more !
12
13. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL Enterprise Monitor provides real-
time visibility into the performance and
availability of all your MySQL
databases.
– MySQL Enterprise Monitor product home page
13
14. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
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
14
15. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
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
15
16. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL Enterprise Monitor: The Dashboard
16
SLA monitoring
Real-time
performance
monitoring
Alerts and
notifications.
MySQL
Best Practices
advisors
17. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL Enterprise Monitor: The Query Analyzer
17
Real-time query
performance
Visual
correlation
graphs
Find and fix
expensive
queries
Detailed query
statistics
Query response
time index
(QRTi)
18. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL Query Analyzer: Beautiful Reports and Graphs
18
Memory Usage InnoDB Monitoring InnoDB buffer pool
19. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL for Visual Studio
For the visual developer
19
20. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
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/
20
21. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL for Visual Studio: what can it do for you ?
21
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.
22. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Disclaimer:
I’m using a weird Visual Studio Setup !
The screenshots you’re about to see are not that polished !
22
23. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL For Visual Studio: It all starts with a login
23
Go here if you
need to enter a
port
Go to “Server
Explorer” and
hit “Add
Connection”
button to get
this
24. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL For Visual Studio: The MySQL Script Editor
24
File -> New ->
MySQL ->
MySQL Script
Has its own
login details !
Syntax
highlighting !
Can see both
results and
messages
Data are
editable too.
25. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL For Visual Studio: The VS Query Designer
25
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 pane
for a MySQL
column
The “Execute”
button
26. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL For Visual Studio: The Table Editor
26
Double-click on
a table in
“Server
Explorer” to
get here
Or add a new
table
Pretty standard
27. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL For Visual Studio: Views are Editable Too
27
28. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
MySQL For Visual Studio: Debugging Stored Procedures
28
Right-click a
stored
procedure and
pick “Debug”
Standard debug
toolbar !
Standard
current
executed line
You can set
breakpoints too
Call-stackLocals
29. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Command Line
For the old-fashioned DBA and developer
29
30. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Command line tools: All important ones at a glance
Tool Primary Use
mysql Execute individual commands and script files
mysqladmin Start/stop the server, misc. administrative commands
mysql_upgrade Live upgrade of a server instance
mysqldump Dump database objects into script files
mysql_config_editor Manipulate stored login paths
mysqlbinlog Process binary log files
mysqlslap Simple benchmark tool
30
31. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
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
31
32. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
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 !
32
33. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
3d Party Tools
Something for every taste
33
34. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
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
34
35. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Questions And Answers
35
36. Copyright © 2014 Oracle and/or its affiliates. All rights reserved.
Safe Harbor Statement
The 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
Editor's Notes Python
QRTi is a "quality of service" measurement for each query, and it uses the Apdex formula for that calculation: http://en.wikipedia.org/wiki/Apdex
Optimum (1) : 100 ms.
Acceptable(0.5): 100-400 ms.
Unacceptable(0): > 400 ms.
If there are 100 executions of the digested/canonical query, where 60 finished below 100ms (the optimal time frame), 30 between 100ms and 400ms (the acceptable time frame), and the remaining 10 took longer than 400ms (unacceptable time), then the QRTi score is:
( (60 + (30 / 2) + (10*0) ) / 100) = 0.75.