Вы находитесь на странице: 1из 29

PRACTICAL-1

database.

Install and configure MySQL

MySQL is a freely available open source Relational Database Management System (RDBMS)
that uses Structured Query Language (SQL).

MySQL is a database management system.


A database is a structured collection of data. It may be anything from a simple shopping list to
a picture gallery or the vast amounts of information in a corporate network. To 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 as
parts of other applications.

MySQL databases are relational.


A relational database stores data in separate tables rather than putting all the data in one big
storeroom. The database structures are organized into physical files optimized for speed. The
logical model, with objects such as databases, tables, views, rows, and columns, offers a
flexible programming environment. You set up rules governing the relationships between
different data fields, such as one-to-one, one-to-many, unique, required or optional,
and pointers between different tables. The database enforces these rules, so that with a
well-designed database, your application never sees inconsistent, duplicate, orphan, out-ofdate, or missing data.
The SQL part of MySQL stands for Structured Query Language. SQL is the most common
standardized language used to access databases. Depending on your programming
environment, you might enter SQL directly (for example, to generate reports), embed SQL
statements into code written in another language, or use a language-specific API that hides
the SQL syntax.
SQL is defined by the ANSI/ISO SQL Standard. The SQL standard has been evolving since
1986 and several versions exist. In this manual, SQL-92 refers to the standard released in
1992, SQL:1999 refers to the standard released in 1999, and SQL:2003 refers to the
current version of the standard. We use the phrase the SQL standard to mean the current
version of the SQL Standard at any time.

MySQL software is Open Source.

Open Source means that it is possible for anyone to use and modify the software. Anybody
can download the MySQL software from the Internet and use it without paying anything. If you
wish, you may study the source code and change it to suit your needs. The MySQL software
uses the GPL (GNU General Public License), to define what you may and may not do with the
software in different situations. If you feel uncomfortable with the GPL or need to embed
MySQL code into a commercial application, you can buy a commercially licensed version from
us. See the MySQL Licensing Overview for more information

The MySQL Database Server is very fast, reliable, scalable, and easy to use.
If that is what you are looking for, you should give it a try. MySQL Server can run comfortably
on a desktop or laptop, alongside your other applications, web servers, and so on, requiring
little or no attention. If you dedicate an entire machine to MySQL, you can adjust the settings
to take advantage of all the memory, CPU power, and I/O capacity available. MySQL can also
scale up to clusters of machines, networked together.
You can find a performance comparison of MySQL Server with other database managers on
our benchmark page.
MySQL Server was originally developed to handle large databases much faster than existing
solutions and has been successfully used in highly demanding production environments for
several years. Although under constant development, MySQL Server today offers a rich and
useful set of functions. Its connectivity, speed, and security make MySQL Server highly suited
for accessing databases on the Internet.

MySQL Server works in client/server or embedded systems.


The MySQL Database Software is a client/server system that consists of a multi-threaded
SQL server that supports different backends, several different client programs and libraries,
administrative tools, and a wide range of application programming interfaces (APIs).
We also provide MySQL Server as an embedded multi-threaded library that you can link 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 with our users. It
is very likely that your favorite application or language supports the MySQL Database Server.

Follow the instructions below exactly when installing MySQL Server:

Click on the "setup"

Perform a typical installation

<!--[if !vml]--><!--[endif]-->

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 automatically start.
Follow the instructions below carefully to configure your MySQL Server to run correctly with
EventSentry.

Select Detailed Configuration

I was installing it on my local machine where other applications & tools are running I decided to opt
"developer machine" but it is recommended that you use a Dedicated MySQL Server Machine for your
MySQL database, if this is not an option then select "Server Machine".
If you selected Dedicated MySQL Server Machine and your MySQL service does not start after the wizard
completes, then try to re-run the wizard (or re-install) MySQL, but this time select the Server Machine
option.

I have checked "Multifunctional databases" as I wanted MyISAM as default storage engine but if you
want you can select "Transactional Database Only", this will make sure that InnoDB is the main storage
engine. If you have checked 3rd option then only myISAM 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

It is recommended that you leave the default port 3306 in place, however
EventSentry will also work with non-standard ports if necessary.

It is highly recommended that you run the MySQL Server as a Windows


service(you can disable this if you want to start it manually whenever required) and include the binary
directory in the search path.

Specify a secure root password, you may want to check the box Enable root access
from remote machines if you plan on administering your MySQL server
from 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 XP Firewall Settings

Done!!!
But if you are installing MySQL on a Windows XP workstation, or any other computer that has a firewall
enabled, and the wizard fails with an error message similar to the one shown below (Can't connect to
MySQL server on 'localhost'), then you will have to exclude the MySQL daemon from your firewall
configuration

On Windows XP, you can exclude MySQL from the firewall by following the steps below:
1. Navigate to Start -> Settings -> Control Panel -> Windows Firewall

2. In the resulting dialog, enter the information as shown in the screenshot

After clicking OK twice, return to the MySQL error message and select Retry. MySQL should now be able to create the
instance correctly

PRACTICAL-2

Install and use of SQLyog.

SQLyog is a GUI tool for the RDBMS MySQL. It is developed by Webyog.

SQLyog provides you with powerful means to manage your MySQL databases.

Runs on all Windows version from Win XP to Win 8.x (desktop systems) as
well as "Windows Server" systems of same generations (Windows Server
2003 and higher).

MySQL 5.x compatible

Create/Drop/Alter Tables, Stored Procedures, Functions, Views, Triggers and


Events.

HTTP and SSH Tunneling - smartly manage your MySQL server even if the
MySQL port is blocked or remote access to MySQL is disallowed!

Protect your data with SSL encryption.

Smart AutoComplete.

Formats SQL statements.

Proactive Query Profiler.

Favorite Manager to neatly organize your favorite SQL statements.

Very fast retrieval of data.

Advanced GUI Query Builder. Supports JOINs, aggregate as well as


'common' functions, sorting (ORDER BY) and filtering (WHERE and HAVING)
and ALIAS.

SQLyog Import External Data wizard - use the GUI or specify a query.

Schema and Data synchronization tools.

Powerful compressed Scheduled Backup with email notification.

Schedule various jobs.

SQL Scheduler and Reporting Tool - execute unattended queries for database
maintainence of data verification with flexible email option.

Update result returned from query - also supports queries with JOINs. No
dialogues - just edit!

Manage foreign key relationships.

Fully InnoDB compliant.

Supports MySQL pluggable storage engines architecture.

Multi-threaded query execution with option to allow multiple query execution


simultaneously.

View your results in GRID/TEXT mode.

Filter data and resultsets directly form the context menu of a displayed value.

Execute (very large) SQL-scripts as batch files.

Execute multiple queries returning more than 1000s of rows per resultset. Its
very efficient in memory.

Very compact binary.

Written entirely in C/C++/Win32 APIs using native MySQL C APIs. No wrapper


classes used.

Connection manager.

Tabbed interface to create/alter tables.

View and edit advanced table-properties, such as Comment, Key_Length etc.

Do table-diagnostics (check, optimize, repair, analyze)

Duplicate tables to new table-names.

Excel like grid interface to edit data with support for Enum/Set.

Create/Drop databases.

Manage indexes.

Comprehensive user/security manager. Control every available privilege on


what level you like (server/database/table/column).

Reorder columns of table.

Copy database between two MySQL hosts.

Drop all tables of a database with a single click.

Edit BLOBs in TEXT or GRAPICHS mode. All common (non-proprioritary)


graphics format (including 'high-resolution' TIFFs and PNGs) supported.

Export table-structure and data into SQL-dumps.

Direct export to Microsoft Excel.

Export/import data in/from CSV files.

Export database schema in HTML.

Log all queries for a session.

Syntax-highlighting.

Save resultset in CSV, HTML and XML.

Copy your result as CSV to clipboard.

Is very keyboard friendly. You can work with 99% features of SQLyog with
keyboard.

View and kill other user-processes.

Flush Host/Logs/Privileges/Tables.

Quick access to processlist, status, variables etc.

once you are at the download page for the Community Edition, select the latest
version. You can select either the latest beta version or the latest stable release.
After you have downloaded it, run the file to install SQLyog. The installation part is
pretty straightforward, Once you have SQLyog installed, go ahead and start it. Follow
along with these next screenshots to get it set up with your local MySQL Server
connection.

Think of localhost as an alias for the IP address (or in this case MySQL Host
Address) of the computer you are on.

PRACTICAL-3

Install and use of phpmyadmin.

phpMyAdmin is a free and open source tool written in PHP intended to


handle the administration of MySQL with the use of a web browser. It can
perform various tasks such as creating, modifying or
deleting databases, tables, fields or rows; executing SQL statements; or
managing users and permissions.

Features
1. Web interface
2. MySQL database management
3. Import data from CSV and SQL
4. Export data to various formats: CSV, SQL, XML, PDF (via
the TCPDF library), ISO/IEC 26300 - OpenDocument Text and
Spreadsheet, Word, Excel, LaTeX and others
5. Administering multiple servers
6. Creating PDF graphics of the database layout
7. Creating complex queries using Query-by-Example (QBE)
8. Searching globally in a database or a subset of it
9. Transforming stored data into any format using a set of predefined
functions, like displaying BLOB-data as image or download-link

10.
Live charts to monitor MySQL server activity like connections,
processes, CPU/Memory usage, etc.

http://your serverip/phpmyadmin/ now you should see the following


screen here you need to enter your mysql database details username as
root password as your mysql server root password by default mysql root
users doesn't have any password after entering these details press enter
now.

Once you enter in to the phpmyadmin you should see the following screen

Creating Database
Now you need to create a database for this you can see the create
database option in the above screen there you need to enter the database
name and click on create

Creating a table in your database


The left-hand frame in phpMyAdmin is used for navigation, when you log
in, you'll see the database you created displaying in this area. Tables will
also show up under each database once they are created.
Click on the database you created in the navigation frame and
a new window will appear on the right hand side.

We will now create the first table in the database, called "details". This is
done by using the Create new table feature. The name of the new table is
typed into the Name: field, and the number of columns in the table (4)
into Fields:. Please note that when you create your own databases and
tables, it's wise to plan them out carefully to allow for growth - this
exercise is only meant to help you to familiarize with basic
php/MySQL/phpMyAdmin functions.
After you click Go a screen similar to the following should appear. Notice
that the table title will now also appear under the database name in the
left hand navigation frame.

We now need to enter the names and attributes of our table fields. Enter
the following information:
Field
id
name

Type
int
char

Length
6
100

telephone char
date
char

50
50

The Length value indicates the maximum allowable length of characters


for input. There are many different values that can be set for Type; view
further documentation here. The Types specified in this example aren't
the most efficient, but just used for the purposes of this exercise. The "id"
field, which will be used as a Primary key for this table, has been set to
auto_increment, saving you from having to having to type in the next
number in sequence when you input records.
Once you've entered all the values, click Save. A screen similar to the
following will appear.

Now the table is now created. You'll notice that the corresponding SQL
command for creating these fields is also displayed. While you don't really
need to know this for the purposes of this exercise, it doesn't hurt to get

familiar with the lingo over time.


Also on this page, you'll see many other options - explore these later on
once you are familiar with the way everything is working.
Inserting data into the table
Inputting data into your new table is easy. On the current screen, there's
a tab labeled "Insert" - click this and another window should appear,
similar to the following.

Simply type in details for each of the fields for this record. As the "id"
column was specified to automatically increment, you will not need to
enter a number. This number will be unique, no other record will have it
and it will be added once the record is saved.
If you ever get lost while getting familiar with phpMyAdmin navigation,
simply click "Home" in the left hand nav bar and start again.
After you click Save, the record is saved to the details table, and the
previous window we saw reappears with the SQL command for the insert.

Additional records can be added by re-selecting Insert". If you are going


to be inserting multiple records, you can also select the "Insert another
new row" radio button on the input form.

Once you've entered a number of records into the table, you can review
the records by clicking on the Browse tab. You can also select individual
records for editing or deleting.

Once your database starts growing and you don't wish to flick through
pages and pages of records, you can utilize the Select tab to refine
displays.
Backing up your database
Click on your database name in the left hand navigation bar
- Click on EXPORT (top tab)
- Highlight the table/s you want to back up
You can select the whichever option is useful for your under export .If you

want save as file enter the file name and if you want use compression
select the available option for this.

you've created a database, a table and fields, entered in a few records,


viewed the records, edited and perhaps deleted some of them and
practiced backing up.I hope this will help some users how to use
phpmyadmin.

Вам также может понравиться