7/25/2019 PPD PRACT 1-2-3.docx
1/29
PRACTICAL-1 Install and confgure MySQL
database.
MySQL is a freely available open source Relational Database Management System (RDBMS)
that uses Structured Query Language (SQL).
MySQL is a database management system.
database is a structured collection of data. !t may be anything from a simple shopping list to
a picture gallery or the vast amounts of information in a corporate net"or#. $o add% access%
and process data stored in a computer database% you need a database management system
such as MySQL Server. Since computers are very good at handling large amounts of data%
database management systems play a central role in computing% as standalone utilities% or asparts of other applications.
MySQL databases are relational.
relational database stores data in separate tables rather than putting all the data in one big
storeroom. $he database structures are organi&ed into physical files optimi&ed for speed. $he
logical model% "ith ob'ects such as databases% tables% vie"s% ro"s% and columns% offers a
fleible programming environment. ou set up rules governing the relationships bet"een
different data fields% such as one*to*one% one*to*many% uni+ue% re+uired or optional%
and ,pointers- bet"een different tables. $he database enforces these rules% so that "ith a
"ell*designed database% your application never sees inconsistent% duplicate% orphan% out*of*
date% or missing data.
$he SQL part of ,MySQL- stands for ,Structured Query Language-. SQL is the most common
standardi&ed language used to access databases. Depending on your programming
environment% you might enter SQL directly (for eample% to generate reports)% embed SQL
statements into code "ritten in another language% or use a language*specific ! that hides
the SQL synta.
SQL is defined by the /S!0!S1 SQL Standard. $he SQL standard has been evolving since
2345 and several versions eist. !n this manual% ,SQL*36- refers to the standard released in
2336% ,SQL72333- refers to the standard released in 2333% and ,SQL76889- refers to the
current version of the standard. :e use the phrase ,the SQL standard- to mean the current
version of the SQL Standard at any time.
MySQL software is Open Source.
7/25/2019 PPD PRACT 1-2-3.docx
2/29
1pen Source means that it is possible for anyone to use and modify the soft"are. nybody
can do"nload the MySQL soft"are from the !nternet and use it "ithout paying anything. !f you
"ish% you may study the source code and change it to suit your needs. $he MySQL soft"are
uses the ;L (;/< ;eneral ublic License)% to define "hat you may and may not do "ith the
soft"are in different situations. !f you feel uncomfortable "ith the ;L or need to embed
MySQL code into a commercial application% you can buy a commercially licensed version from
us. See the MySQL Licensing 1vervie" for more information
The MySQL Database Server is very fast, reliable, scalable, and easy to use.
!f that is "hat you are loo#ing for% you should give it a try. MySQL Server can run comfortably
on a des#top or laptop% alongside your other applications% "eb servers% and so on% re+uiring
little or no attention. !f you dedicate an entire machine to MySQL% you can ad'ust the settings
to ta#e advantage of all the memory% =< po"er% and !01 capacity available. MySQL can also
scale up to clusters of machines% net"or#ed together.
ou can find a performance comparison of MySQL Server "ith other database managers on
our benchmar# page.
MySQL Server "as originally developed to handle large databases much faster than eisting
solutions and has been successfully used in highly demanding production environments for
several years. lthough under constant development% MySQL Server today offers a rich and
useful set of functions. !ts connectivity% speed% and security ma#e MySQL Server highly suited
for accessing databases on the !nternet.
MySQL Server works in client/server or embedded systems.
$he MySQL Database Soft"are is a client0server system that consists of a multi*threaded
SQL server that supports different bac#ends% several different client programs and libraries%
administrative tools% and a "ide range of application programming interfaces (!s).
:e also provide MySQL Server as an embedded multi*threaded library that you can lin# into
your application to get a smaller% faster% easier*to*manage standalone product.
A large amount of contributed MySQL software is available.
MySQL Server has a practical set of features developed in close cooperation "ith our users. !t
is very li#ely that your favorite application or language supports the MySQL Database Server.
7/25/2019 PPD PRACT 1-2-3.docx
3/29
Follow the instructions below exactly when installing MySQL Server:
Click on the "setup"
7/25/2019 PPD PRACT 1-2-3.docx
4/29
Perfor a typical installation
7/25/2019 PPD PRACT 1-2-3.docx
5/29
7/25/2019 PPD PRACT 1-2-3.docx
6/29
>?**@if ?vmlA**>?**@endifA**
Check box to configure MySQL Server
If you checked the Configure the MySQL Server now check box on the final dialog of the MySQL
Server installation, then the MySQL Server Instance Configuration Wizard will autoatically start!
"ollow the instructions below carefully to configure your MySQL Server to run correctly with
#ventSentry!
7/25/2019 PPD PRACT 1-2-3.docx
7/29
Select $etailed Configuration
I was installing it on y local achine where other a%%lications & tools are running I decided to o%t
'develo%er achine' but it is recoended that you use a $edicated MySQL Server Machine for your
MySQL database, if this is not an o%tion then select 'Server Machine'!
If you selected $edicated MySQL Server Machine and your MySQL service does not start after the wizard
co%letes, then try to re(run the wizard )or re(install* MySQL, but this tie select the Server Machine
o%tion!
7/25/2019 PPD PRACT 1-2-3.docx
8/29
I have checked 'Multifunctional databases' as I wanted MyIS+M as default storage engine but if you
want you can select 'ransactional $atabase -nly', this will ake sure that Inno$. is the ain storage
engine! If you have checked /rd o%tion then only yIS+M engine would be available
Select the drive where the database files will be stored!
Select the drive on the fastest drive)s* on your server
7/25/2019 PPD PRACT 1-2-3.docx
9/29
It is recoended that you leave the default %ort //01 in %lace, however
#ventSentry will also work with non(standard %orts if necessary!
7/25/2019 PPD PRACT 1-2-3.docx
10/29
It is highly recoended that you run the MySQL Server as a Windows
service)you can disable this if you want to start it anually whenever re2uired* and include the binary
directory in the search %ath!
7/25/2019 PPD PRACT 1-2-3.docx
11/29
S%ecify a secure root %assword, you ay want to check the box #nable root access
fro reote achines if you %lan on adinistering your MySQL server
fro your workstation or other servers!
If you are getting an error message after clicking the Next button, then please enable port
3306
in the Windows X !irewall "ettings
7/25/2019 PPD PRACT 1-2-3.docx
12/29
$one333
.ut if you are installing MySQL on a Windows 45 workstation, or any other co%uter that has a firewall
enabled, and the wizard fails with an error essage siilar to the one shown below )Can6t connect to
MySQL server on 6localhost6*, then you will have to exclude the MySQL daeon fro your firewall
configuration
7/25/2019 PPD PRACT 1-2-3.docx
13/29
-n Windows 45, you can exclude MySQL fro the firewall by following the ste%s below7
8! 9avigate to Start (: Settings (: Control 5anel (: Windows "irewall
! #n the resulting $ialog% enter the inforation as shown in the screenshot
7/25/2019 PPD PRACT 1-2-3.docx
14/29
&fter clicking '( twice% return to the MySQL error essage an$ select )etry MySQL shoul$ now be able to create the
instance correctly
PRACTICAL-2 Install and use o SQLyog.
SQLyogis a ;
http://en.wikipedia.org/wiki/Graphical_user_interfacehttp://en.wikipedia.org/wiki/RDBMShttp://en.wikipedia.org/wiki/MySQLhttp://en.wikipedia.org/wiki/RDBMShttp://en.wikipedia.org/wiki/MySQLhttp://en.wikipedia.org/wiki/Graphical_user_interface7/25/2019 PPD PRACT 1-2-3.docx
15/29
SQLyogprovides you "ith po"erful means to manage your MySQL databases.
Runs on all :indo"s version from :in C to :in 4. (des#top systems) as
"ell as :indo"s Server systems of same generations (:indo"s Server6889 and higher).
MySQL E. compatible
=reate0Drop0lter $ables% Stored rocedures% Functions% Gie"s% $riggers and
Hvents.
I$$ and SSI $unneling * smartly manage your MySQL server even if the
MySQL port is bloc#ed or remote access to MySQL is disallo"ed?
rotect your data "ith SSL encryption.
Smart uto=omplete.
Formats SQL statements.
roactive Query rofiler.
Favorite Manager to neatly organi&e your favorite SQL statements.
Gery fast retrieval of data.
dvanced ;
Schema and Data synchroni&ation tools.
o"erful compressed Scheduled Bac#up "ith email notification.
Schedule various 'obs.
SQL Scheduler and Reporting $ool * eecute unattended +ueries for database
maintainence of data verification "ith fleible email option.
7/25/2019 PPD PRACT 1-2-3.docx
16/29
Supports MySQL pluggable storage engines architecture.
Multi*threaded +uery eecution "ith option to allo" multiple +uery eecution
simultaneously.
Gie" your results in ;R!D0$HC$ mode.
Filter data and resultsets directly form the contet menu of a displayed value.
Hecute (very large) SQL*scripts as batch files.
Hecute multiple +ueries returning more than 2888s of ro"s per resultset. !ts
very efficient in memory.
Gery compact binary.
:ritten entirely in =0=0:in96 !s using native MySQL = !s. /o "rapper
classes used.
=onnection manager.
$abbed interface to create0alter tables.
Gie" and edit advanced table*properties% such as =omment% eyNLength etc.
Do table*diagnostics (chec#% optimi&e% repair% analy&e)
Duplicate tables to ne" table*names.
Hcel li#e grid interface to edit data "ith support for Hnum0Set.
=reate0Drop databases.
Manage indees.
=omprehensive user0security manager. =ontrol every available privilege on"hat level you li#e (server0database0table0column).
Reorder columns of table.
=opy database bet"een t"o MySQL hosts.
Drop all tables of a database "ith a single clic#.
Hdit BL1Bs in $HC$ or ;R!=IS mode. ll common (non*proprioritary)
graphics format (including Khigh*resolutionK $!FFs and /;s) supported.
7/25/2019 PPD PRACT 1-2-3.docx
17/29
Hport table*structure and data into SQL*dumps.
Direct eport to Microsoft Hcel.
Hport0import data in0from =SG files.
Hport database schema in I$ML.
Log all +ueries for a session.
Synta*highlighting.
Save resultset in =SG% I$ML and CML.
=opy your result as =SG to clipboard.
!s very #eyboard friendly. ou can "or# "ith 33O features of SQLyog "ith
#eyboard.
Gie" and #ill other user*processes.
Flush Iost0Logs0rivileges0$ables.
Quic# access to processlist% status% variables etc.
once you are at the do"nload page for the =ommunity Hdition% select the latest
version. ou can select either the latest beta version or the latest stable release.
fter you have do"nloaded it% run the file to install SQLyog. $he installation part is
pretty straightfor"ard% 1nce you have SQLyog installed% go ahead and start it. Follo"
along "ith these net screenshots to get it set up "ith your local MySQL Server
connection.
7/25/2019 PPD PRACT 1-2-3.docx
18/29
7/25/2019 PPD PRACT 1-2-3.docx
19/29
$hin# of localhost as an alias for the ! address (or in this case MySQL Iost
ddress) of the computer you are on.
7/25/2019 PPD PRACT 1-2-3.docx
20/29
7/25/2019 PPD PRACT 1-2-3.docx
21/29
PRACTICAL-3 Install and use of phpmyadmin.
php#y$dminis a free and o%en sourcetool written in 5;5intended to
handle the adinistration of MySQLwith the use of a web browser! It can
%erfor various tasks such as creating, odifying or
deleting databases, tables, fieldsor rows< executing SQLstateents< or
anaging users and %erissions!
"eatures
8! Web interface
=! MySQL database anageent
/! I%ort data fro CS>and SQL
?! #x%ort data to various forats7 CS>, SQL, 4ML, 5$")via
the C5$"library*, IS-@I#C =1/00 ( -%en$ocuent ext and
S%readsheet, Word, #xcel, Lae4and others
A! +dinistering ulti%le servers
1! Creating 5$" gra%hics of the database layout
B! Creating co%lex 2ueries using Query(by(#xa%le )Q.#*
! Searching globally in a database or a subset of it
D! ransforing stored data into any forat using a set of %redefined
functions, like dis%laying .L-.(data as iage or download(link
http://en.wikipedia.org/wiki/Free_and_open_sourcehttp://en.wikipedia.org/wiki/PHPhttp://en.wikipedia.org/wiki/MySQLhttp://en.wikipedia.org/wiki/Web_browserhttp://en.wikipedia.org/wiki/Databasehttp://en.wikipedia.org/wiki/Table_(database)http://en.wikipedia.org/wiki/Field_(computer_science)http://en.wikipedia.org/wiki/Row_(database)http://en.wikipedia.org/wiki/SQLhttp://en.wikipedia.org/wiki/Comma-separated_valueshttp://en.wikipedia.org/wiki/SQLhttp://en.wikipedia.org/wiki/Comma-separated_valueshttp://en.wikipedia.org/wiki/SQLhttp://en.wikipedia.org/wiki/XMLhttp://en.wikipedia.org/wiki/Portable_Document_Formathttp://en.wikipedia.org/wiki/TCPDFhttp://en.wikipedia.org/wiki/LaTeXhttp://en.wikipedia.org/wiki/BLOBhttp://en.wikipedia.org/wiki/Free_and_open_sourcehttp://en.wikipedia.org/wiki/PHPhttp://en.wikipedia.org/wiki/MySQLhttp://en.wikipedia.org/wiki/Web_browserhttp://en.wikipedia.org/wiki/Databasehttp://en.wikipedia.org/wiki/Table_(database)http://en.wikipedia.org/wiki/Field_(computer_science)http://en.wikipedia.org/wiki/Row_(database)http://en.wikipedia.org/wiki/SQLhttp://en.wikipedia.org/wiki/Comma-separated_valueshttp://en.wikipedia.org/wiki/SQLhttp://en.wikipedia.org/wiki/Comma-separated_valueshttp://en.wikipedia.org/wiki/SQLhttp://en.wikipedia.org/wiki/XMLhttp://en.wikipedia.org/wiki/Portable_Document_Formathttp://en.wikipedia.org/wiki/TCPDFhttp://en.wikipedia.org/wiki/LaTeXhttp://en.wikipedia.org/wiki/BLOB7/25/2019 PPD PRACT 1-2-3.docx
22/29
80! Live charts to onitor MySQL server activity like connections,
%rocesses, C5E@Meory usage, etc!
htt%7@@your serveri%@%h%yadin@ now you should see the following
screen here you need to enter your ys2l database details usernae as
root %assword as your ys2l server root%assword by default ys2l root
users doesn6t have any %assword after entering these details %ress enter
now!
-nce you enter in to the %h%yadin you should see the following screen
http://www.debianhelp.co.uk/phpmyadmin.htmhttp://www.debianhelp.co.uk/phpmyadmin.htm7/25/2019 PPD PRACT 1-2-3.docx
23/29
%reating &atabase
9ow you need to create a database for this you can see the create
database o%tion in the above screen there you need to enter the database
nae and click on create
%reating a table in your database
he left(hand frae in %h%My+din is used for navigation, when you log
in, you6ll see the database you created dis%laying in this area! ables will
also show u% under each database once they are created!
Click on the database you created in the navigation frae and
a new windowwill a%%ear on the right hand side!
http://www.debianhelp.co.uk/phpmyadmin.htmhttp://www.debianhelp.co.uk/phpmyadmin.htm7/25/2019 PPD PRACT 1-2-3.docx
24/29
We will now create the first table in the database, called 'details'! his is
done by using the Create new table feature! he nae of the new table is
ty%ed into the 9ae7 field, and the nuber of coluns in the table )?*into "ields7! 5lease note that when you create your own databases and
tables, it6s wise to %lan the out carefully to allow for growth ( this
exercise is only eant to hel% you to failiarize with basic
%h%@MySQL@%h%My+din functions!
+fter you click Fo a screen siilar to the following should a%%ear! 9otice
that the table title will now also a%%ear under the database nae in the
left hand navigation frae!
We now need to enter the naes and attributes of our table fields! #nter
the following inforation7
"ield y%e Length
id int 1
nae char 800
7/25/2019 PPD PRACT 1-2-3.docx
25/29
tele%hone char A0
date char A0
he Length value indicates the axiu allowable length of characters
for in%ut! here are any different values that can be set for y%e< view
further docuentation here! he y%es s%ecified in this exa%le aren6t
the ost efficient, but Gust used for the %ur%oses of this exercise! he 'id'
field, which will be used as a 5riary key for this table, has been set to
autoHincreent, saving you fro having to having to ty%e in the next
nuber in se2uence when you in%ut records!
-nce you6ve entered all the values, click Save! + screen siilar to the
following will a%%ear!
9ow the table is now created! ou6ll notice that the corres%onding SQL
coand for creating these fields is also dis%layed! While you don6t reallyneed to know this for the %ur%oses of this exercise, it doesn6t hurt to get
7/25/2019 PPD PRACT 1-2-3.docx
26/29
failiar with the lingo over tie!
+lso on this %age, you6ll see any other o%tions ( ex%lore these later on
once you are failiar with the way everything is working!
Inserting data into the table
In%utting data into your new table is easy! -n the current screen, there6s
a tab labeled 'Insert' ( click this and another window should a%%ear,
siilar to the following!
Si%ly ty%e in details for each of the fields for this record! +s the 'id'
colun was s%ecified to autoatically increent, you will not need to
enter a nuber! his nuber will be uni2ue, no other record will have it
and it will be added once the record is saved!
If you ever get lost while getting failiar with %h%My+din navigation,
si%ly click ';oe' in the left hand nav bar and start again!
+fter you click Save, the record is saved to the details table, and the%revious window we saw rea%%ears with the SQL coand for the insert!
7/25/2019 PPD PRACT 1-2-3.docx
27/29
+dditional records can be added by re(selecting Insert'! If you are going
to be inserting ulti%le records, you can also select the 'Insert another
new row' radio buttonon the in%ut for!
-nce you6ve entered a nuber of records into the table, you can review
the records by clicking on the .rowse tab! ou can also select individual
records for editing or deleting!
-nce your database starts growing and you don6t wish to flick through
%ages and %ages of records, you can utilize the Select tab to refine
dis%lays!
'acking up your database
Click on your database nae in the left hand navigation bar
( Click on #45-J )to% tab*
( ;ighlight the table@s you want to back u%
ou can select the whichever o%tion is useful for your under ex%ort !If you
http://www.debianhelp.co.uk/phpmyadmin.htmhttp://www.debianhelp.co.uk/phpmyadmin.htmhttp://www.debianhelp.co.uk/phpmyadmin.htmhttp://www.debianhelp.co.uk/phpmyadmin.htm7/25/2019 PPD PRACT 1-2-3.docx
28/29
want save as file enter the file nae and if you want use co%ression
select the available o%tion for this!
you6ve created a database, a table and fields, entered in a few records,
viewed the records, edited and %erha%s deleted soe of the and
%racticed backing u%!I ho%e this will hel% soe users how to use
%h%yadin!
7/25/2019 PPD PRACT 1-2-3.docx
29/29