Professional Documents
Culture Documents
Online Mysql2 Training
Online Mysql2 Training
Online Mysql2 Training
CONTACT US ON : vibranttechnologies.co.in
Content:
CONTACT US ON :
vibranttechnologies.co.in
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 ).
CONTACT US ON :
vibranttechnologies.co.in
CONTACT US ON :
vibranttechnologies.co.in
CONTACT US ON :
vibranttechnologies.co.in
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
CONTACT US ON :
vibranttechnologies.co.in
Configuring MySql
CONTACT US ON :
vibranttechnologies.co.in
Support
Works on many different platforms like FreeBSD ,
NetBSD , Linux 2.0+, Windows 95, 98, 2000 & NT, HPUX etc
There are client tools and APIs available in c, c++,
java, perl, python, php, Tcl
CONTACT US ON :
vibranttechnologies.co.in
Security in mysql
Issues that bother: eavesdropping,altering
Uses ACLs (Access Control Lists) , also theres 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
CONTACT US ON :
vibranttechnologies.co.in
CONTACT US ON :
vibranttechnologies.co.in
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
noninteractive access has to be done
Inbuilt functions for hashing: password,
encrypt,encode,decode
CONTACT US ON :
vibranttechnologies.co.in
CONTACT US ON :
vibranttechnologies.co.in
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
CONTACT US ON :
vibranttechnologies.co.in
tables.
Write locks enable you to read and write exclusively.
Other threads cant access/update currently locked
tables
Write locks have higher priority than read locks
CONTACT US ON :
vibranttechnologies.co.in
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
CONTACT US ON :
vibranttechnologies.co.in
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)
CONTACT US ON :
vibranttechnologies.co.in
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 nonupdating queries to the replica server.
CONTACT US ON :
vibranttechnologies.co.in
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)
CONTACT US ON :
vibranttechnologies.co.in
CONTACT US ON :
vibranttechnologies.co.in
HOW TO (MASTER)
CONTACT US ON :
vibranttechnologies.co.in
Thank You
Contact us on :
Vibrattechnologies.co.in