SlideShare a Scribd company logo
1 of 27
A Brief Introduction to MySQL
Pointers
 What is MySQL ? Its good features.
 Installation guide.
 Security and Privilege System
 Compatibility with standards
 Locks – an interesting feature
 Table types
 Some more salient features
 Replication
What Is MySQL?
 A fast, reliable, easy-to-use, multi-user multi-
threaded relational database system.
 It is freely available and released under GPL
(GNU General Public License ).
Why Use MySQL ?
 MySQL server can handle very large
databases.
 Offers rich and very useful set of functions.
 Connectivity, speed and security make MySQL
very suited for accessing database on a
network.
 A lot of contributed software available.
What Does MySQL Offer ?
 A privilege and password system that is very
flexible and secure and allows host-based
verification.
 Multi-threaded request-handling using kernel
thread.
 Replication features.
 Very actively developed.
 Memory leak proof.
Quick Installation Guide
• tar –zxvf Mysql.x.xx.xx.tar.gz
 cd Mysql-x.xx.xx.xx
 ./configure –prefix=/usr/local/mysql
 make
 make install
 scripts/mysql_install_db
 safe_mysqld
 Mysql –u root password ‘mypassword’
Configuring MySql
 --bindir=Dir specifies dir for binaries
 --localstatedir=Dir data dir
 --with-tcp-port=portno
 --with-unix-sock-path=absolute-path
 --with-mysqld-ldflag=-all-static
 --with-charset=charset (default Latin1)
 --with-low-memory
Support
 Works on many different platforms like
FreeBSD , NetBSD , Linux 2.0+, Windows ’95,
’98, 2000 & NT, HP-UX etc
 There are client tools and APIs available in c,
c++, java, perl, python, php, Tcl
Security in mysql
 Issues that bother: eavesdropping,altering
 Uses ACL’s (Access Control Lists) , also
there’s some support for SSL connections
 Has inbuilt methods for storing confidential
data like passwords in encrypted form.
 Access is restricted thru grant of privileges to
users,hosts
Privileges provided by mysql
 The five tables:
user,db,host,tables_priv,columns_priv
 The privileges come into play only if there is a
retrieval of data from the database, or updation
of data in the database,e.g:
select 1+1; calculator 
 File privilege : load data infile, select …. Into
outfile
How the privilege system works
 First reference to user followed by db and host , takes
place during connection verification
 Reference to tables_priv and columns_priv at data
access stage
 Ordering of user table on the basis of more specific
host values first, followed by more specific user values.
 For security purposes , mysql disallows host
addresses of the form :192.168.7.yahoo.com
Some tips on security
 Beneficial to invest in a firewall ; check using “telnet
server_port 3306”
 Do not rely on the data entered by the user, he can
trick the code by using special character sequences
 Make use of tcpdump, to check the whether or not
mysql data streams r unencrypted:
tcpdump –l –i eth0 –w – src port 3306|strings
 Dont run mysqld as root.
 Don’t give process and file privileges to users as far as
possible.
Continued…..
 Following mysqld options affect security:
1. –- secure 2. – skip-grant-privileges
3. – skip-name-resolve 4. –skip-networking
 Passwords by default are stored in hashed form in
database.But if the scrambled password is known the
hacker can still log in as the user.
 Passwords can be stored in my.cnf file when
non-interactive access has to be done
 Inbuilt functions for hashing: password,
encrypt,encode,decode
Compatibility with Standards
What doesn’t MySQL have ?
 Transactions – no provision for commit and
rollback
 No nested sub-queries
 Views are not supported
 Foreign keys not used for referential integrity
checks
Compatibility (contd.)
What extra does MySQL have ?
 Locking/Unlocking of tables
 Atomicity of operations
 Directory organization
 Access of tables across tables
 Several other features, discussed later…
More about Locks !
 Locks help in maintaining integrity, atomicity
 Read locks – enable you to only read from the
locked tables.
 Write locks – enable you to read and write
exclusively. Other threads can’t access/update
currently locked tables
 Write locks have higher priority than read locks
MySql Table Types
 Creates a .frm file that holds the table and column definition.
 Syntax for defining table type is .. :
CREATE TABLE test ( )
TYPE=HEAP ..
 Categorization of types : Transaction safe type and Non
transaction safe type.
 Transaction Safe table types allow rollbacks,restore changes if
update fails ,etc .
 Non Transaction Safe table types are much faster ,use less
disk space as well as memory for updates.
MyISAM tables
 Use B-Tree indexing to store the keys, string indexes
are compressed .
 MyISAM itself supports three different table formats: a)
static (fixed length) b) Dynamic c) Compressed
 Static : fastest ,secure and simplest format ,
used when there are no varchar, blob or text.
 Dynamic : each record stores a header that contain its
length
 Compressed : created using myisampack tool , they
are read only ,use very little space as each record is
compressed separately
 ISAM is a deprecated version of MyISAM
Merge tables
 A collection of identical MyISAM tables which are used
collectively.
 FOR eg :
CREATE TABLE t1 (a INT AUTO_INCREMENT
PRIMARY KEY, message CHAR(20));
CREATE TABLE t2 (a INT AUTO_INCREMENT
PRIMARY KEY, message CHAR(20)) ;
CREATE TABLE total (a INT NOT NULL, message
CHAR(20), KEY(a)) TYPE=MERGE UNION=(t1,t2)
• allowed : select ,insert and Operations update .
Heap tables and Berkley DB
 Use hashed index and are stored in memory
 Generally used for temporary tables .
•Berkley DB is used for making the tables
transaction safe
MySQL Language Reference
OPTIMIZE
 Syntax :: … OPTIMIZE TABLE tbl_name[,tbl_name]..
 Used only for MyISAM tables
 It performs the following functions :repairs the table if the table has
deleted rows,sorts the index,and the statistics are also made to
date.
CHECK
 Syntax :: … CHECK
TABLE tbl_name[,tbl_name...] [TYPE = [QUICK | FAST | EXTEND
| CHANGED]]
MySQL Language Reference
 Checks a table for errors and updates the key
statistics of the table
BACKUP
 BACKUP TABLE tbl_name[,tbl_name...] TO
'/path/to/backup/directory‘
 This again works only for MyISAM
ANALYZE
 During analysis the table is locked with a read
lock
MySQL Language Reference
REPAIR
 Syntax:
REPAIR TABLE tbl_name[,tbl_name...] [TYPE = QUICK]
FLUSH
 Syntax :
FLUSH flush_option [,flush_option]
 Used to clear the internal cache of Mysql
 It has various options like HOSTS,LOGS,PRIVELEDGES,
TABLES tbl_names,etc
Replication in MySQL
 What??
 One server is designated as the master, while the other
( or others) as slave(s)
 Updates done only on master and binary logs made
 The slave connects to the master, catches up on the
missed updates, and then starts receiving updates
immediately as they come to the master.
 Why??
 For robustness you have two systems and switch to
the backup if you have problems with the master.
 The extra speed is achieved by sending a part of the
non-updating queries to the replica server.
How To (SLAVE)
• Upgrade both slave and master to 3.23.15 or higher.
• PUT THESE IN my.cnf of SLAVE
• master-host,user,passwd
• server-id=< unique no>= 1 & <=2^32-1
• master-connect-retry !! (keep trying)
• master-info-file
• replicate-rewrite-db
• skip-slave-start
• Restart the slave(s)
How To (SLAVE) (contd)
• Take a snapshot of all the tables/databases on
the master
• Use command LOAD TABLE <tblname>
FROM MASTER (3.23.23)+
 SLAVE START/STOP
 FLUSH SLAVE
HOW TO (MASTER)
 log-bin , FLUSH MASTER , FLUSH SLAVE
 When you start the slave thread will be created
 Tables are not Locked
 SET SQL_LOG_BIN=0/1
 CHANGE MASTER TO master_def_list

More Related Content

What's hot

MySQL For Oracle Developers
MySQL For Oracle DevelopersMySQL For Oracle Developers
MySQL For Oracle DevelopersRonald Bradford
 
My sql technical reference manual
My sql technical reference manualMy sql technical reference manual
My sql technical reference manualMir Majid
 
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007eLiberatica
 
MySQL 简要介绍
MySQL 简要介绍MySQL 简要介绍
MySQL 简要介绍YUCHENG HU
 
Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10Vasudeva Rao
 
My sql storage engines
My sql storage enginesMy sql storage engines
My sql storage enginesVasudeva Rao
 
MySQL DBA OCP 1Z0-883
MySQL DBA OCP 1Z0-883MySQL DBA OCP 1Z0-883
MySQL DBA OCP 1Z0-883Kwaye Kant
 
Ten Reasons Why You Should Prefer PostgreSQL to MySQL
Ten Reasons Why You Should Prefer PostgreSQL to MySQLTen Reasons Why You Should Prefer PostgreSQL to MySQL
Ten Reasons Why You Should Prefer PostgreSQL to MySQLanandology
 
MySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and DevelopersMySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and DevelopersRonald Bradford
 
MySQL PHP native driver : Advanced Functions / PHP forum Paris 2013
 MySQL PHP native driver  : Advanced Functions / PHP forum Paris 2013   MySQL PHP native driver  : Advanced Functions / PHP forum Paris 2013
MySQL PHP native driver : Advanced Functions / PHP forum Paris 2013 Serge Frezefond
 
MySQL Guide for Beginners
MySQL Guide for BeginnersMySQL Guide for Beginners
MySQL Guide for BeginnersDainis Graveris
 
MySQL Reference Manual
MySQL Reference ManualMySQL Reference Manual
MySQL Reference Manualwebhostingguy
 
MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016
MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016
MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016Dave Stokes
 

What's hot (17)

MySQL For Oracle Developers
MySQL For Oracle DevelopersMySQL For Oracle Developers
MySQL For Oracle Developers
 
Mysql all
Mysql allMysql all
Mysql all
 
Mysql all
Mysql allMysql all
Mysql all
 
My sql technical reference manual
My sql technical reference manualMy sql technical reference manual
My sql technical reference manual
 
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
 
MySQL 简要介绍
MySQL 简要介绍MySQL 简要介绍
MySQL 简要介绍
 
Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10Upgrading mysql version 5.5.30 to 5.6.10
Upgrading mysql version 5.5.30 to 5.6.10
 
My sql storage engines
My sql storage enginesMy sql storage engines
My sql storage engines
 
Mysql tutorial 5257
Mysql tutorial 5257Mysql tutorial 5257
Mysql tutorial 5257
 
MySQL DBA OCP 1Z0-883
MySQL DBA OCP 1Z0-883MySQL DBA OCP 1Z0-883
MySQL DBA OCP 1Z0-883
 
Ten Reasons Why You Should Prefer PostgreSQL to MySQL
Ten Reasons Why You Should Prefer PostgreSQL to MySQLTen Reasons Why You Should Prefer PostgreSQL to MySQL
Ten Reasons Why You Should Prefer PostgreSQL to MySQL
 
MySQL DBA
MySQL DBAMySQL DBA
MySQL DBA
 
MySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and DevelopersMySQL For Oracle DBA's and Developers
MySQL For Oracle DBA's and Developers
 
MySQL PHP native driver : Advanced Functions / PHP forum Paris 2013
 MySQL PHP native driver  : Advanced Functions / PHP forum Paris 2013   MySQL PHP native driver  : Advanced Functions / PHP forum Paris 2013
MySQL PHP native driver : Advanced Functions / PHP forum Paris 2013
 
MySQL Guide for Beginners
MySQL Guide for BeginnersMySQL Guide for Beginners
MySQL Guide for Beginners
 
MySQL Reference Manual
MySQL Reference ManualMySQL Reference Manual
MySQL Reference Manual
 
MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016
MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016
MySQL Utilities -- Cool Tools For You: PHP World Nov 16 2016
 

Viewers also liked (20)

BITS: Introduction to relational databases and MySQL - SQL
BITS: Introduction to relational databases and MySQL - SQLBITS: Introduction to relational databases and MySQL - SQL
BITS: Introduction to relational databases and MySQL - SQL
 
Mysql introduction
Mysql introduction Mysql introduction
Mysql introduction
 
Mysql
MysqlMysql
Mysql
 
Download It
Download ItDownload It
Download It
 
Plsql
PlsqlPlsql
Plsql
 
PPT
PPTPPT
PPT
 
Mysql1
Mysql1Mysql1
Mysql1
 
Introduction to MySQL
Introduction to MySQLIntroduction to MySQL
Introduction to MySQL
 
MySQL clients
MySQL clientsMySQL clients
MySQL clients
 
MySQL lecture
MySQL lectureMySQL lecture
MySQL lecture
 
Mysql database
Mysql databaseMysql database
Mysql database
 
MySQL Sandbox 3
MySQL Sandbox 3MySQL Sandbox 3
MySQL Sandbox 3
 
An introduction to MySQL
An introduction to MySQLAn introduction to MySQL
An introduction to MySQL
 
Mysql an introduction
Mysql an introductionMysql an introduction
Mysql an introduction
 
MySQL Introduction
MySQL IntroductionMySQL Introduction
MySQL Introduction
 
MySQL
MySQLMySQL
MySQL
 
Introduction to MySQL
Introduction to MySQLIntroduction to MySQL
Introduction to MySQL
 
CBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL PresentationCBSE XII Database Concepts And MySQL Presentation
CBSE XII Database Concepts And MySQL Presentation
 
MySql slides (ppt)
MySql slides (ppt)MySql slides (ppt)
MySql slides (ppt)
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 

Similar to Mysql Introduction

Online Mysql ppt training
Online Mysql ppt trainingOnline Mysql ppt training
Online Mysql ppt trainingvibrantuser
 
Learn my sql at amc square learning
Learn my sql at amc square learningLearn my sql at amc square learning
Learn my sql at amc square learningASIT Education
 
My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)Gustavo Rene Antunez
 
Securing your database servers from external attacks
Securing your database servers from external attacksSecuring your database servers from external attacks
Securing your database servers from external attacksAlkin Tezuysal
 
Collaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAsCollaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAsNelson Calero
 
Performence tuning
Performence tuningPerformence tuning
Performence tuningVasudeva Rao
 
Mysql 2007 Tech At Digg V3
Mysql 2007 Tech At Digg V3Mysql 2007 Tech At Digg V3
Mysql 2007 Tech At Digg V3epee
 
MySQL Server Backup, Restoration, And Disaster Recovery Planning Presentation
MySQL Server Backup, Restoration, And Disaster Recovery Planning PresentationMySQL Server Backup, Restoration, And Disaster Recovery Planning Presentation
MySQL Server Backup, Restoration, And Disaster Recovery Planning PresentationColin Charles
 
How to Manage Scale-Out Environments with MariaDB MaxScale
How to Manage Scale-Out Environments with MariaDB MaxScaleHow to Manage Scale-Out Environments with MariaDB MaxScale
How to Manage Scale-Out Environments with MariaDB MaxScaleMariaDB plc
 
Privilege Escalation with Metasploit
Privilege Escalation with MetasploitPrivilege Escalation with Metasploit
Privilege Escalation with Metasploitegypt
 
My sql crashcourse_intro_kdl
My sql crashcourse_intro_kdlMy sql crashcourse_intro_kdl
My sql crashcourse_intro_kdlsqlhjalp
 
MySQL HA with PaceMaker
MySQL HA with  PaceMakerMySQL HA with  PaceMaker
MySQL HA with PaceMakerKris Buytaert
 

Similar to Mysql Introduction (20)

Mysql2
Mysql2Mysql2
Mysql2
 
Mysql
MysqlMysql
Mysql
 
Mysql2
Mysql2Mysql2
Mysql2
 
Online Mysql ppt training
Online Mysql ppt trainingOnline Mysql ppt training
Online Mysql ppt training
 
Learn my sql at amc square learning
Learn my sql at amc square learningLearn my sql at amc square learning
Learn my sql at amc square learning
 
Fudcon talk.ppt
Fudcon talk.pptFudcon talk.ppt
Fudcon talk.ppt
 
My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)My First 100 days with a MySQL DBMS (WP)
My First 100 days with a MySQL DBMS (WP)
 
Mysql-Basics.pptx
Mysql-Basics.pptxMysql-Basics.pptx
Mysql-Basics.pptx
 
Mysql tutorial
Mysql tutorialMysql tutorial
Mysql tutorial
 
Sql material
Sql materialSql material
Sql material
 
My sql basic
My sql basicMy sql basic
My sql basic
 
Securing your database servers from external attacks
Securing your database servers from external attacksSecuring your database servers from external attacks
Securing your database servers from external attacks
 
Collaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAsCollaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAs
 
Performence tuning
Performence tuningPerformence tuning
Performence tuning
 
Mysql 2007 Tech At Digg V3
Mysql 2007 Tech At Digg V3Mysql 2007 Tech At Digg V3
Mysql 2007 Tech At Digg V3
 
MySQL Server Backup, Restoration, And Disaster Recovery Planning Presentation
MySQL Server Backup, Restoration, And Disaster Recovery Planning PresentationMySQL Server Backup, Restoration, And Disaster Recovery Planning Presentation
MySQL Server Backup, Restoration, And Disaster Recovery Planning Presentation
 
How to Manage Scale-Out Environments with MariaDB MaxScale
How to Manage Scale-Out Environments with MariaDB MaxScaleHow to Manage Scale-Out Environments with MariaDB MaxScale
How to Manage Scale-Out Environments with MariaDB MaxScale
 
Privilege Escalation with Metasploit
Privilege Escalation with MetasploitPrivilege Escalation with Metasploit
Privilege Escalation with Metasploit
 
My sql crashcourse_intro_kdl
My sql crashcourse_intro_kdlMy sql crashcourse_intro_kdl
My sql crashcourse_intro_kdl
 
MySQL HA with PaceMaker
MySQL HA with  PaceMakerMySQL HA with  PaceMaker
MySQL HA with PaceMaker
 

Recently uploaded

Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Sheetaleventcompany
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$kojalkojal131
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Delhi Call girls
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Servicegwenoracqe6
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...singhpriety023
 
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.CarlotaBedoya1
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.soniya singh
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLimonikaupta
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Standkumarajju5765
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.soniya singh
 
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service OnlineCALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Onlineanilsa9823
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGAPNIC
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)Damian Radcliffe
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝soniya singh
 

Recently uploaded (20)

Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
INDIVIDUAL ASSIGNMENT #3 CBG, PRESENTATION.
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service OnlineCALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
CALL ON ➥8923113531 🔝Call Girls Lucknow Lucknow best sexual service Online
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOG
 
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 

Mysql Introduction

  • 2. Pointers  What is MySQL ? Its good features.  Installation guide.  Security and Privilege System  Compatibility with standards  Locks – an interesting feature  Table types  Some more salient features  Replication
  • 3. What Is MySQL?  A fast, reliable, easy-to-use, multi-user multi- threaded relational database system.  It is freely available and released under GPL (GNU General Public License ).
  • 4. Why Use MySQL ?  MySQL server can handle very large databases.  Offers rich and very useful set of functions.  Connectivity, speed and security make MySQL very suited for accessing database on a network.  A lot of contributed software available.
  • 5. What Does MySQL Offer ?  A privilege and password system that is very flexible and secure and allows host-based verification.  Multi-threaded request-handling using kernel thread.  Replication features.  Very actively developed.  Memory leak proof.
  • 6. Quick Installation Guide • tar –zxvf Mysql.x.xx.xx.tar.gz  cd Mysql-x.xx.xx.xx  ./configure –prefix=/usr/local/mysql  make  make install  scripts/mysql_install_db  safe_mysqld  Mysql –u root password ‘mypassword’
  • 7. Configuring MySql  --bindir=Dir specifies dir for binaries  --localstatedir=Dir data dir  --with-tcp-port=portno  --with-unix-sock-path=absolute-path  --with-mysqld-ldflag=-all-static  --with-charset=charset (default Latin1)  --with-low-memory
  • 8. Support  Works on many different platforms like FreeBSD , NetBSD , Linux 2.0+, Windows ’95, ’98, 2000 & NT, HP-UX etc  There are client tools and APIs available in c, c++, java, perl, python, php, Tcl
  • 9. Security in mysql  Issues that bother: eavesdropping,altering  Uses ACL’s (Access Control Lists) , also there’s some support for SSL connections  Has inbuilt methods for storing confidential data like passwords in encrypted form.  Access is restricted thru grant of privileges to users,hosts
  • 10. Privileges provided by mysql  The five tables: user,db,host,tables_priv,columns_priv  The privileges come into play only if there is a retrieval of data from the database, or updation of data in the database,e.g: select 1+1; calculator   File privilege : load data infile, select …. Into outfile
  • 11. How the privilege system works  First reference to user followed by db and host , takes place during connection verification  Reference to tables_priv and columns_priv at data access stage  Ordering of user table on the basis of more specific host values first, followed by more specific user values.  For security purposes , mysql disallows host addresses of the form :192.168.7.yahoo.com
  • 12. Some tips on security  Beneficial to invest in a firewall ; check using “telnet server_port 3306”  Do not rely on the data entered by the user, he can trick the code by using special character sequences  Make use of tcpdump, to check the whether or not mysql data streams r unencrypted: tcpdump –l –i eth0 –w – src port 3306|strings  Dont run mysqld as root.  Don’t give process and file privileges to users as far as possible.
  • 13. Continued…..  Following mysqld options affect security: 1. –- secure 2. – skip-grant-privileges 3. – skip-name-resolve 4. –skip-networking  Passwords by default are stored in hashed form in database.But if the scrambled password is known the hacker can still log in as the user.  Passwords can be stored in my.cnf file when non-interactive access has to be done  Inbuilt functions for hashing: password, encrypt,encode,decode
  • 14. Compatibility with Standards What doesn’t MySQL have ?  Transactions – no provision for commit and rollback  No nested sub-queries  Views are not supported  Foreign keys not used for referential integrity checks
  • 15. Compatibility (contd.) What extra does MySQL have ?  Locking/Unlocking of tables  Atomicity of operations  Directory organization  Access of tables across tables  Several other features, discussed later…
  • 16. More about Locks !  Locks help in maintaining integrity, atomicity  Read locks – enable you to only read from the locked tables.  Write locks – enable you to read and write exclusively. Other threads can’t access/update currently locked tables  Write locks have higher priority than read locks
  • 17. MySql Table Types  Creates a .frm file that holds the table and column definition.  Syntax for defining table type is .. : CREATE TABLE test ( ) TYPE=HEAP ..  Categorization of types : Transaction safe type and Non transaction safe type.  Transaction Safe table types allow rollbacks,restore changes if update fails ,etc .  Non Transaction Safe table types are much faster ,use less disk space as well as memory for updates.
  • 18. MyISAM tables  Use B-Tree indexing to store the keys, string indexes are compressed .  MyISAM itself supports three different table formats: a) static (fixed length) b) Dynamic c) Compressed  Static : fastest ,secure and simplest format , used when there are no varchar, blob or text.  Dynamic : each record stores a header that contain its length  Compressed : created using myisampack tool , they are read only ,use very little space as each record is compressed separately  ISAM is a deprecated version of MyISAM
  • 19. Merge tables  A collection of identical MyISAM tables which are used collectively.  FOR eg : CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, message CHAR(20)); CREATE TABLE t2 (a INT AUTO_INCREMENT PRIMARY KEY, message CHAR(20)) ; CREATE TABLE total (a INT NOT NULL, message CHAR(20), KEY(a)) TYPE=MERGE UNION=(t1,t2) • allowed : select ,insert and Operations update .
  • 20. Heap tables and Berkley DB  Use hashed index and are stored in memory  Generally used for temporary tables . •Berkley DB is used for making the tables transaction safe
  • 21. MySQL Language Reference OPTIMIZE  Syntax :: … OPTIMIZE TABLE tbl_name[,tbl_name]..  Used only for MyISAM tables  It performs the following functions :repairs the table if the table has deleted rows,sorts the index,and the statistics are also made to date. CHECK  Syntax :: … CHECK TABLE tbl_name[,tbl_name...] [TYPE = [QUICK | FAST | EXTEND | CHANGED]]
  • 22. MySQL Language Reference  Checks a table for errors and updates the key statistics of the table BACKUP  BACKUP TABLE tbl_name[,tbl_name...] TO '/path/to/backup/directory‘  This again works only for MyISAM ANALYZE  During analysis the table is locked with a read lock
  • 23. MySQL Language Reference REPAIR  Syntax: REPAIR TABLE tbl_name[,tbl_name...] [TYPE = QUICK] FLUSH  Syntax : FLUSH flush_option [,flush_option]  Used to clear the internal cache of Mysql  It has various options like HOSTS,LOGS,PRIVELEDGES, TABLES tbl_names,etc
  • 24. Replication in MySQL  What??  One server is designated as the master, while the other ( or others) as slave(s)  Updates done only on master and binary logs made  The slave connects to the master, catches up on the missed updates, and then starts receiving updates immediately as they come to the master.  Why??  For robustness you have two systems and switch to the backup if you have problems with the master.  The extra speed is achieved by sending a part of the non-updating queries to the replica server.
  • 25. How To (SLAVE) • Upgrade both slave and master to 3.23.15 or higher. • PUT THESE IN my.cnf of SLAVE • master-host,user,passwd • server-id=< unique no>= 1 & <=2^32-1 • master-connect-retry !! (keep trying) • master-info-file • replicate-rewrite-db • skip-slave-start • Restart the slave(s)
  • 26. How To (SLAVE) (contd) • Take a snapshot of all the tables/databases on the master • Use command LOAD TABLE <tblname> FROM MASTER (3.23.23)+  SLAVE START/STOP  FLUSH SLAVE
  • 27. HOW TO (MASTER)  log-bin , FLUSH MASTER , FLUSH SLAVE  When you start the slave thread will be created  Tables are not Locked  SET SQL_LOG_BIN=0/1  CHANGE MASTER TO master_def_list