MySQL Proxy Boston MySQL User Group Monday, September 24th, 2007 Sheeri Kritzer, MySQL DBA Technocation, Inc.

Slides:



Advertisements
Similar presentations
PHP SQL. Connection code:- mysql_connect("server", "username", "password"); Connect to the Database Server with the authorised user and password. Eg $connect.
Advertisements

MySQL Access Privilege System
SSH SSH is “Secure SHell” Secure, compressed, widely supported, fast Allows both users to get jobs done, and also allows system administrators to sleep.
DB Relay An Introduction. INSPIRATION Database access is WAY TOO HARD The crux.
Aqua Data Studio. Find the application We are using Aqua Data Studio v11.
Radius based ssh authentication Location of Radius server – radius-server host auth-port 1812 acct-port 1813 key WinRadius – The same config.
Microsoft Office Access 2013 Microsoft Office Access 2013 Courseware # 3255 Lesson 6: Protecting, Maintaining and Managing Databases.
Forms. Form An HTML form is a section of a document containing normal content, special elements called controls (checkboxes, radio buttons, buttons, etc.),
Project Implementation for COSC 5050 Distributed Database Applications Lab1.
IWebfolio Overview For Owners (students). Functional Model.
This presentation will guide you though the initial stages of installation, through to producing your first report Click your mouse to advance the presentation.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
PHP Hypertext PreProcessor. Documentation Available SAMS books O’Reilly Books.
Analysis of SQL injection prevention using a proxy server By: David Rowe Supervisor: Barry Irwin.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
Module 14: WCF Send Adapters. Overview Lesson 1: Introduction to WCF Send Adapters Lesson 2: Consuming a Web Service Lesson 3: Consuming Services from.
Set 13: Web Servers (configuration and security) (Chapter 21) IT452 Advanced Web and Internet Systems.
CS 3630 Database Design and Implementation. Your Oracle Account UserName is the same as your UWP username Followed Not case sensitive Initial.
1 Alice DAQ Configuration DB
Analysis of SQL injection prevention using a proxy server By: David Rowe Supervisor: Barry Irwin.
Installing and Using MySQL and phpMyAdmin. Last Time... Installing Apache server Installing PHP Running basic PHP scripts on the server Not necessary.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Website Development with PHP and MySQL Saving Data.
CS395 Internship Melanie Tarr. Company Overview Midwives and patients informally tied towels together, giving one end to the laboring woman and the other.
mysql-proxy By Farhad Saberi - Overview and architecture - Making The case for a proxy - Lua - Lua examples - The admin interface - currently.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Analysis of SQL injection prevention using a filtering proxy server By: David Rowe Supervisor: Barry Irwin.
Prof Frankl, Spring 2008CS Polytechnic University 1 Overview of Web database applications with PHP.
Oracle 11g DATABASE DEVELOPMENT LAB1. Introduction  Oracle 11g Database:-  Oracle 11g database is designed for some features, which helps to the organizations.
Intro to DatabasesClass 4 SQL REVIEW To talk to the database, you have to use SQL SQL is used by many databases, not just MySQL. SQL stands for Structured.
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting MySQL – Inserting Data.
Unit 5 Microsoft SQL Server and MySQL. Key Concepts DBMS variations SQL Server features SQL Server Management Studio MySQL features Scripts Queries Database.
DATABASE TOOLS CS 260 Database Systems. Overview  Database accounts  Oracle SQL Developer  MySQL Workbench.
GOAL User Interactive Web Interface Update Pages by Club Officers Two Level of Authentication.
CD Collection Hector Urtubia Fall Summary Motivation and Objective Technologies Used Project Design Database Design and Integration Demo.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
MySQL Getting Started BCIS 3680 Enterprise Programming.
MySQL MySQL and PHP – interacting with a database.
Defending Applications Against Command Insertion Attacks Penn State Web Conference 2003 Arthur C. Jones June 18, 2003.
Dept user Logs in from Home Page for Bid Opening Login with user name and password.
Lab 3.21 MySQL Database Lab Developing the Tools May 5 th, 2004 Montréal, Québec Dominik Gehl Hôpital Ste-Justine, Montréal.
Introduction to SQL Server  Working with MS SQL Server and SQL Server Management Studio.
MySQL Getting Started BCIS 3680 Enterprise Programming.
Ali Haydar Karapınar Bahadir Ünsal Sabri Safa Öztürk Fatih Aydilek COVE A Musical Talent Mobile Application.
MySQL Security MySQL User Conference & Expo Tuesday, April 24 th, 2007 Sheeri Kritzer, MySQL DBA
PDO Database Connections MIS 3501, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 3/8/2016.
PDO Database Connections
CS 3630 Database Design and Implementation
CS320 Web and Internet Programming SQL and MySQL
Database Mysql Hayk Avdalyan.
Authentication & .htaccess
SQL Server 2000 and Access 2000 limits
LINUX ADMINISTRATION 1
Web Design and Development
Developing Production Quality SQL Code
Current outstanding balance
PDO Database Connections
Aqua Data Studio.
Lesson 6: Protecting, Maintaining and Managing Databases
PDO Database Connections
SSH SSH is “Secure SHell” Secure, compressed, widely supported, fast
PDO Database Connections
MySQL User Privileges: Grant
Create New User in Database. First Connect the System.
CS3220 Web and Internet Programming SQL and MySQL
CS3220 Web and Internet Programming SQL and MySQL
Michigan Mutual, Inc. Imaging Upload Tutorial
Presentation transcript:

MySQL Proxy Boston MySQL User Group Monday, September 24th, 2007 Sheeri Kritzer, MySQL DBA Technocation, Inc.

Overview ➲ Architecture ➲ Lua ➲ Examples

Architecture ➲ Proxy ➲ Flexibility lies in simplicity Change what's sent Change what's received Change where it's sent Add functionality

Override Functions ➲ read_query() ➲ read_query_result() ➲ connect_server()

Override Functions (continued) ➲ read_handshake() ➲ read_auth() ➲ read_auth_result()

Starting mysql-proxy ➲ Specify lua script ➲ Default proxy_backend_address= :3306 ➲ Default proxy_address =:4040

But First, Some Lua! ➲ Fast, small scripting language ➲ Stable, mature ➲ lua.org, lua-users.org

Lua Comments ➲ -- comment, whole or mid-line ➲ --[[ a ➲ multi-line ➲ comment --]] ➲ NOT #, // or /* */ !!

Lua Commands ➲ if... then... end statement ➲ == operator ➲ function ( [args] )... end

Lua Commands ➲ if... then... end statement ➲ == operator ➲ function ( [args] )... end Technically, = function ( [args ] )... end

Lua Object Methods ➲ string:byte([i],[j]) i defaults to 1; j defaults to i ➲ string:sub(i,[j]) j defaults to -1 (length of string)

Specific to MySQL Proxy ➲ proxy.COM_QUERY ➲ Finally, the example!

Specific to MySQL Proxy ➲ proxy.COM_QUERY ➲ Finally, the example! ➲ Note: lua script can change on the fly!

Tokens ➲ mysql-proxy (current) ➲ Avoids the need for regular expressions ➲ Adds knowledge

read_query() ➲ Query modification/injection ➲ Query logging ➲ Query redirecting

read_query_result() ➲ Must exist when proxy.PROXY_SEND_QUERY used in read_query() ➲ Monitoring/Auditing ➲ Query redirecting

connect_server() ➲ proxy.connection backend_ndx thread_id ➲ proxy.servers address connected_clients state

read_handshake() ➲ Server information ➲ mysqld_version ➲ thread_id

read_handshake() ➲ scramble ➲ server_addr ➲ client_addr

read_auth() ➲ username ➲ password (encrypted, nondeterministic) ➲ default db

read_auth() ➲ The good stuff! ➲ Can reject logins ➲ Watch the watcher!

read_auth_result() ➲ OK ➲ Error ➲ Result Packet, not Command Packet

mysql-proxy wish list ➲ Startup scripts ➲ Integration with my.cnf, my.ini config files ➲ HA

Feedback? ➲ Other ideas ➲ Questions ➲ Hackfest!