bgoug 2014: developing using mysql

37
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

Upload: georgi-kodinov

Post on 27-Jan-2015

105 views

Category:

Technology


2 download

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

Page 1: BGOUG 2014: Developing Using MySQL

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

Page 2: BGOUG 2014: Developing Using MySQL

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

Page 3: BGOUG 2014: Developing Using MySQL

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 3

MySQL WorkbenchThe developer’s and DBA’s Swiss army knife

Page 4: BGOUG 2014: Developing Using MySQL

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

Page 5: BGOUG 2014: Developing Using MySQL

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

Page 6: BGOUG 2014: Developing Using MySQL

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

Page 7: BGOUG 2014: Developing Using MySQL

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.

Page 8: BGOUG 2014: Developing Using MySQL

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

Page 9: BGOUG 2014: Developing Using MySQL

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

Page 10: BGOUG 2014: Developing Using MySQL

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

Page 11: BGOUG 2014: Developing Using MySQL

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

Page 12: BGOUG 2014: Developing Using MySQL

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 12

MySQL Enterprise MonitorAll a serious DBA needs. And more !

Page 13: BGOUG 2014: Developing Using MySQL

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

Page 14: BGOUG 2014: Developing Using MySQL

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

Page 15: BGOUG 2014: Developing Using MySQL

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

Page 16: BGOUG 2014: Developing Using MySQL

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

Page 17: BGOUG 2014: Developing Using MySQL

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)

Page 18: BGOUG 2014: Developing Using MySQL

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

Page 19: BGOUG 2014: Developing Using MySQL

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 19

MySQL for Visual StudioFor the visual developer

Page 20: BGOUG 2014: Developing Using MySQL

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/

Page 21: BGOUG 2014: Developing Using MySQL

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.

Page 22: BGOUG 2014: Developing Using MySQL

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 !

Page 23: BGOUG 2014: Developing Using MySQL

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

Page 24: BGOUG 2014: Developing Using MySQL

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.

Page 25: BGOUG 2014: Developing Using MySQL

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

Page 26: BGOUG 2014: Developing Using MySQL

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

Page 27: BGOUG 2014: Developing Using MySQL

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 27

MySQL For Visual Studio: Views are Editable Too

Page 28: BGOUG 2014: Developing Using MySQL

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

Page 29: BGOUG 2014: Developing Using MySQL

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 29

Command LineFor the old-fashioned DBA and developer

Page 30: BGOUG 2014: Developing Using MySQL

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

Page 31: BGOUG 2014: Developing Using MySQL

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

Page 32: BGOUG 2014: Developing Using MySQL

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 !

Page 33: BGOUG 2014: Developing Using MySQL

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 33

3d Party ToolsSomething for every taste

Page 34: BGOUG 2014: Developing Using MySQL

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

Page 35: BGOUG 2014: Developing Using MySQL

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. 35

Questions And Answers

Page 36: BGOUG 2014: Developing Using MySQL

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

Page 37: BGOUG 2014: Developing Using MySQL