my s q l linux install

34
<Insert Picture Here> MySQL Installation and Basic 杜修文 , MySQL Sr. Sales Consultant [email protected] July 2010

Upload: tu-ivan

Post on 28-Jan-2015

106 views

Category:

Documents


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: My S Q L  Linux Install

<Insert Picture Here>

MySQL Installation and Basic杜修文 , MySQL Sr. Sales [email protected]

July 2010

Page 2: My S Q L  Linux Install

• Download & Install MySQL Server• Configure MySQL Server• MySQL Entgerprise• Install MySQL Enterprise Monitor• Team Building

Highly confidential - Oracle Corporation 2

Agenda

Page 3: My S Q L  Linux Install

With RPM

DownloadAnd Install

MySQL Server

Page 4: My S Q L  Linux Install

The download web sitehttp://dev.mysql.com/downloads/

Determine the product to be downloadCommunity Server GA Releases Development Releases

MySQL ClusterMySQL WorkbenchMySQL ProxyMySQL ConnectorsDetermine the Platform

Download MySQL Server

Page 5: My S Q L  Linux Install

Installing MySQL from RPM Packages on Linux

Install MySQL on RPM-based Linux distributionsFor non-RPM Linux distributions, you can install MySQL using a .tar.gz packageInstall with RPM

rpm -qa : to list old MySQL package, rpm -e: remove the packages

rpm -Uvh <rpm file name> bin/mysql_install_db –user=mysql –

basedir=<basedir> --datadir=<datadir>

Page 6: My S Q L  Linux Install

More MySQL rpm packages

MySQL-server-VERSION.glibc23.i386.rpm MySQL-client-VERSION.glibc23.i386.rpm MySQL-devel-VERSION.glibc23.i386.rpm MySQL-debuginfo-VERSION.glibc23.i386.rpm MySQL-shared-VERSION.glibc23.i386.rpm MySQL-shared-compat-VERSION.glibc23.i386.rpm MySQL-embedded-VERSION.glibc23.i386.rpm

Refer: http://dev.mysql.com/doc/refman/5.5/en/linux-rpm.html

Page 7: My S Q L  Linux Install

Location of the files by RPM

Program files /usr/share/mysql/

mysql-<size>.ini, mysql.server /usr/bin/

mysql, mysqladmin, mysqld_safe, mysql, mysql_install_db

/usr/sbin/ mysqld, mysqld-debug

Data Directory /var/lib/mysql/data

Page 8: My S Q L  Linux Install

Install MySQL Server with tar.gz

groupadd mysql useradd -g mysql mysql cd /usr/local gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf - ln -s full-path-to-mysql-VERSION-OS mysql cd mysql chown -R mysql . chgrp -R mysql . scripts/mysql_install_db --user=mysql chown -R root . chown -R mysql data bin/mysqld_safe --user=mysql &

Page 9: My S Q L  Linux Install

Upgrade MySQL to a newer version

With tar.gz Backup the datadir Unzip the tar.gz to a new directory Recreate the symbolic link to the new directory Run upgrade script - mysql_upgrade

With rpm Backup the datadir Remove the old package Install with rpm -Uvh <rpm_file> Move the backed up data to the datadir, change the owner

of the datadir Run upgrade script - mysql_upgrade

Page 10: My S Q L  Linux Install

Basic tuning and Replication Setups

ConfigureMySQL Server

Page 11: My S Q L  Linux Install

MySQL Options and Option File

my.cnf /etc ~/ <base_dir>

Page 12: My S Q L  Linux Install

Import options in my.cnf--basedir--datadir--autocommit--log--log-bin--log-slow-query--binlog-format--key-buffer_size--innodb_buffer_pool_size--server-id--port--query_cache_size--socket--sql-mode--max_connections--character_set_server, --character_set-client,

Refer: http://dev.mysql.com/doc/refman/5.5/en/mysqld-option-tables.html

Page 13: My S Q L  Linux Install

Start MySQL automically

Winodws"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld" –install MySQL

--defaults-file=C:\my-opts.ini

Linux• cp mysql.server /etc/rc.d/init.d/mysql• chmod +x /etc/rd.c/init.d/mysql• chkconfig --add mysql

Page 14: My S Q L  Linux Install

Making MySQL Better Today

MySQL Enterprise

Page 15: My S Q L  Linux Install

Spend time to save money or Spend money to save time?

Open Source

Benefits from testing by worldwide Community

Feature Releases Mature Mature

Benchmarked with 2,000+ connections

Rapid Update Service Pack Program

Quarterly Service Pack Program

Hot Fix Program

MySQL Enterprise Monitor and Advisors

MySQL Query Analyzer

Bug Escalation Privilege

Live feeds for Software/Support Status updates

Online Knowledge Base

24x7 Production/Consulting Support Services

Extended End-of-Life Support Policy

Legal indemnification

MySQL Enterprise vs Community Server

Page 16: My S Q L  Linux Install

• Single, consolidated view into entire MySQL environment

• Auto-discovery of MySQL servers, replication topologies

• Customizable rules-based monitoring and alerts

• Query monitoring and analysis

• Identifies problems before they occur

• Reduces risk of downtime

• Makes it easier to scale out without requiring more DBAs

A Virtual MySQL DBA Assistant!

MySQL Enterprise Monitor

Page 17: My S Q L  Linux Install

• Centralized monitoring of Queries across all servers• No reliance on Slow Query

Logs, SHOW PROCESSLIST;, VMSTAT, etc.• Aggregated view of query

execution counts, time, and rows• Saves time parsing atomic

executions for total query expense

MySQL Query Analyzer

Page 18: My S Q L  Linux Install

Upgrade Advisor

Replication Advisor Security Advisor

Replication Monitor

Memory Usage Advisor

Schema Advisor

Performance Advisor

Administration Advisor Custom Advisors Notifications and Alerts

Web-based Enterprise Dashboard

Enterprise Platinum

Enterprise Gold

Enterprise Silver

Enterprise Basic

Enterprise Monitor

Query Analyzer/Graph Corr.

Advisors by Subscription Level

Page 19: My S Q L  Linux Install

Support

Platinum

Gold +• Query Review• Schema Review• Performance Tuning

• Custom Code Review

• Highest 24x7 SLA

• New Performance, Schema Advisors

• New Graphs

Gold

Silver +• Advanced Server• Query Analyzer /Graph Correlation

• Replication Monitor• Hot Fix builds• Partitioning Review• Replication Review• Remote Troubleshooting

• DRBD for MySQL• Memcached for MySQL

• Indemnification (option)

• 24x7 Support

Silver

Basic +

Enterprise Monitor

Extended Lifecycle Support

Business Hour Phone Support

Live Feeds for Product and Support Updates

Installation Advantage

Subscription Level Upgrades

Page 20: My S Q L  Linux Install

MySQL Enterprise Customer Site

Page 21: My S Q L  Linux Install

Fixed Annual Cost/Subscription– Unlimited Servers– Unlimited CPUs– Unlimited Cores

Simplified Deployment– No Counting– No Compliance Issues

Pricing– No proprietary DBMS license fees

MySQL Enterprise Unlimited

Page 22: My S Q L  Linux Install

Making MySQL Better Today

Install MySQL Enterprise

Monitor

Page 23: My S Q L  Linux Install

MySQL Enterprise Monitor 2.2

• Improved Performance Monitoring• MySQL Query Analyzer• Data from MySQL Connectors• For Java and .Net apps

• Filter for Specific Query Problems • Full Table Scans, Bad Indexes

• Faster Problem Resolution• MySQL Support diagnostic reports

• Improved User/Security Model• Improved Advisor Rules & Graphs

Page 24: My S Q L  Linux Install

• Configuration• Advisor Scheduling• Alerts/Notifications• Visual Monitoring• Query Analysis

Service Agent written in C and supports all MySQL Enterprise platforms

Service Manager written in Java servlets exposed as web services. Supports Linux, Solaris, Mac OSX and Microsoft Windows

Enterprise Dashboard Web-based, written in JSP

Repository holds historical performance data for analysis

Individual Servers w/Agent

Master-Slave ReplicationEnterprise Dashboard

Service Manager

Repository

Customer Datacenter

• Advisor Monitoring• Event based Alerts• Advice/Corrective Actions

Collects MySQL and OS specific metrics, Query content/stats

Holds historical MySQL and OS data, Query Statistics

Enterprise Monitor Architecture

Page 25: My S Q L  Linux Install

Highly confidential - Oracle Corporation 25

Install MySQL Enterprise Monitor

– Download MEM from the MySQL Enterprise web site– Install Enterprise Monitor– Install MEM agent– Configure MEM, – Apply Advisory, Key from the MEM page– Start MEM

Page 26: My S Q L  Linux Install

Monitoring Queries with MySQL Proxy

1. MySQL Enterprise Monitor & Query Analyzer2. MySQL Proxy & Agent

List of components to download & configure:

Application Server MySQL Database

(SQL statements & result sets)

3306

18080

2. MySQL Proxy& MySQL Agent **

6446

(MySQL, OS monitoring data, SQL performance data: statements, examples, EXPLAINs, aggregated stats)

1. MySQL Enterprise Monitor (Service Manager, Dashboard)

** MySQL Proxy is optionally deployed and configured as a plugin with the MySQL Agent

Page 27: My S Q L  Linux Install

Monitoring Queries with Connector/J, NET

1. MySQL Enterprise Monitor & Query Analyzer2. MySQL Agent3. Connector/J v5.1 or newer/ Connector/NET v6.2 or newer4. New! MySQL Enterprise Plugin for Connector/J, NET

List of components to download & configure:

MySQL Database

(SQL statements & result sets)

(MySQL & OS monitoring data)

3. Connector/J, NET

4. Plugin for Connector/J, NET

(SQL performance data: statements, examples, EXPLAINs, aggregated stats)

3306

18080

2. MySQL Agent

1. MySQL Enterprise Monitor (Service Manager, Dashboard)

Application Server

Page 28: My S Q L  Linux Install

New Query Analyzer Global Search Options

• New filters for queries that performed• Full table scans• Full table scans using bad indexes

Page 29: My S Q L  Linux Install

Improved User and Security Model

• New LDAP Authentication • Integrates with existing directories (SSO)

Page 30: My S Q L  Linux Install

Improved User and Security Model

• New Read Only User • Can view monitored data but cannot make any changes

Page 31: My S Q L  Linux Install

Making MySQL Better Today

Team Building

Page 32: My S Q L  Linux Install

Share with you

My blog Mhttp://voicefromoldsoul.blogspot.com/MySQL 技術轉運站

http://groups.google.com.tw/group/mysql_techhttp://dev.mysql.comhttp://planet.mysql.com

Page 33: My S Q L  Linux Install

What's next?1.Hands on practice and demo environment

● Install MySQL databases● Install MySQL workbench● Configure MySQL database to optimize the databases● Setups master-slave configuration● Install MySQL Enterprise Monitor

2.Introduction to DRBD and Heartbeat● Install/configure DRBD● Install/configure heartbeat

3.Introduction to MySQL proxy● Install/configure MySQL Proxy

4.Introduction to MySQL Cluster● Install/configure MySQL Cluster

Shared on Mine MySQL Blog and MySQL技術轉運站

Page 34: My S Q L  Linux Install