You are on page 1of 27

EXPERIMENT:-1

Aim: Install and configure MYSQL database.

Step1: Windows configures MySQL Installer.

Step2: Welcome Screen: A welcome screen provides several options. Choose the first
option: Install MySQL products.
[

Step3: Download the latest MySQL products: MySQL installer checks and downloads the
latest MySQL products including MySQL server, MySQL workbench, etc.

196470307005 1
Step4: Click next button to continue.

Step5: Choosing a setup type : There are several setup types available. Choose the full
option to install all MySQL products and features.

STEP 6: Checking Requirements.

196470307005 2
Step7: Installation Progress: MySQL installer downloads all selected products. It will take a
while, depending on which products that you selected and the speed of your internet
connection.

 Installation progress: Downloading products in progress. 

 Installation progress: Complete downloading. Click next button to continue….

196470307005 3
Step8: Configuration overview. Click next button to configure MySQL database server.

Step8.1: MySQL server configuration: Choose config type and MySQL port (3006 by
default) and click next button to continue.

Step8.2: MySQL server configuration: Choose a password for the root account.
Please note the password download and keep it securely if you are installing MySQL
database server on a production server. If you want to add a more MySQL user, you
can do it in this step.

196470307005 4
Step8.3: MySQL server configuration: Choose windows service details including
windows service name and account type, then click next button to continue.

Step8.4: MySQL server configuration-In progress: MySQL installer is configuring


MySQL database server. Wail until it is done and click next button to continue.

Step8.5: MySQL server configuration –Done. Click next button to continue.

196470307005 5
Step8.6: Configuration overview: MySQL installer installs sample databases and
sample models.

Step9: Installation Completes: the installation completes. Click finish button to close the
installation wizard and launch the MySQL workbench.

196470307005 6
EXPERIMENT:-2
Aim: Install and use of SQLYOG.
A. Download SQLYOG.
Step1: SQLYog is a freeware. You can download it at webyog.com. Click on “Download”
in the SQLYog community edition.

Step2: Click on SQLYog Community Edition 5.2(stable) in the binaries. A window open,
asking you what you want to do. And choose “Record”. A new window will open and asking
you WHERE you want to record this files.








196470307005 7
Step3: Make one click on “My documents” on the left, next click on “Record”. When
download is finished you should see this window and choose “Execute” for launching the
installation. If you don’t have this window, go to “My documents” and make 2 clicks on the
file that you have just downloaded.

B. Installation of SQLYog.
Step1: After you have click on ”Execute”, you should see this window. Just click on “next
button.

196470307005 8
Step2: In this page about the licence, choose “I accept the term…” and click on “Next”.

Step3: The window below, ask you where you want to record the program on your
computer.

Step4: Choose a destination directory, and click on “Install”.

196470307005 9
Step5: Then click on “Next”. Click on “finish” for finishing the installation in the following
window.

C. Connect database using SQLYOG


Step1: Connect to MySQL host dialog box appears when you open Webyog

Step2: Enter the information under the MySQL tab.

Step3: Enter the information under the SSH tab.

196470307005 10
Step4: Click on “Test Connection”.

196470307005 11
EXPERIMENT:-3
Aim: Install and use of PHPMYADMIN.

Step1: Open the PhpMyAdmin download page. Go to https://www.phpmyadmin.net/ in


your browser.

Step2: Click Download. It’s a green button in the upper-right side of the page. The
PhpMyAdmin ZIP folder will begin downloading in your computer.

Step3: Click choose when prompted. This will return you to the PhpMyAdmin webpage.

Step4: Open the phpMyAdmin folder. Double click the downloaded phpmyAdmin ZIP
folder to do.

196470307005 12
Step5: Copy the phpMyAdmin folder’s contents. Click the regular phpMyAdmin folder in
the ZIP folder’s window, then press Ctrl+C.

Step6: Go to Apache host folder. This is typically a folder named “htdocs” inside of the
“Apache” folder, which should be located in the “C:” folder on your hard drive.

Step7: paste the copied folder into the host folder. Press Ctrl+V to paste the copied
phpMyAdmin folder into the Apache host folder.

Step8: Change the copied folder’s name to phpMyAdmin. Click the phpmyAdmin folder,
click home, click Rename in the toolbar, type phpMyAdmin into the folder’s name field, and
press ↵ Enter.

Step9: Run your apache server.

Step10: Open localhost/phpMyAdmin. This will show following window.

196470307005 13
Step11: Default username is root and password is null. Now click on “GO” and go to the
phpMyAdmin window.

196470307005 14
EXPERIMENT:-4
Aim: Install and use of MYSQL browser.
Step1: Double click the msi file.

Step2: Windows installer splash screen will be launched.

Step3: The setup wizard welcome page is shown below. Click “Next”;

STEP 4: Accept the license and agreement and click “Next”.

196470307005 15
Step7: Click Install if you are ready. If you want to change the previously set
settings, just hit the Back button.

Step8: The Installation is in progress.

Step9: Click “Next”.

196470307005 16
Step10: Click “Next”.

Step11: Click “Finish”.

196470307005 17
EXPERIMENT:-5
Aim: Install and use of MYSQL ADMINISTRATOR.
Step1: MySQL Administrator. Click the MySQL Administrator. We are logging as root, so
enter the root password. If you already have MySQL user other than root then you can use it
to login. The 3306 is a standard MySQL port. We use to login to localhost (127.0.0.1) where
our MySQL has been installed. If you have MySQL installed on other server, use the server
name or IP address. Fill in the required information as shown below and click “OK”.

Step2: The details is shown in the following figure.

Step3: Let explore what we have in this MySQL GUI. First page is server information page.
It is just read only information.

196470307005 18
Step4: The following is the service control information page. We can stop and start the
MySQL service here.

Step5: The configure service tab contains more information.

Step6: The following is start up variables page. Explore all the tabs and there are many
settings that can be set or unset.

196470307005 19
Step7: The following is User Administration page. We can add new MySQL user here and
assign privileges.

Step8: The following is schema privileges page. We can see available privileges assigned to
the database schema or modify the current privileges.

196470307005 20
Step9: The following is a resources page.

Step10: The following is the Server Connection Information page.

Step11: The following is MySQL health status page. Browse all the tabs.

196470307005 21
Step12: The following is MySQL server logs page.

Step13: The following is Replication status page. If there is any replication implemented we
can see it there.

Step14: The following is the backup information page. We can create a backup and
schedule it

196470307005 22
Step15: Let try making a backup. Click the “New Project” button, put a backup project
name and select items to be backed up. Click “Execute Backup Now”.

Step16: The following is the restore page.

Step17: Finally, the catalogs. Quite many things can be done here. Select one database
under the Schemata. In this case, we select any one database. Click the “Details>>” button.

196470307005 23
So, this is all the information about MySQL Administrator.

196470307005 24
EXPERIMENT:-6
Aim: Create a product table and Write a routine for counting all product
types.
Code:
DELIMITER $$
USE `1905 `$$
DROP PROCEDURE IF EXISTS `counting`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `counting`()
BEGIN
SELECT product_type,COUNT(*) FROM producttable GROUP BY
product_type;
END$$
DELIMITER ;
CALL counting();

Output:

196470307005 25
EXPERIMENT:-7
Aim: Write a routine for updating price of all products by 5%.
Code:
DELIMITER $$
USE `1905`$$
DROP PROCEDURE IF EXISTS `percantage`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `percantage`()
BEGIN
UPDATE producttable SET product_price=product_price+(product_price*0.05);
SELECT *FROM producttable;
END$$
DELIMITER ;
CALL percentage;

Output:

196470307005 26
EXPERIMENT:-8
Aim: Create product_price_history table. The price of product change
constantly. Write a trigger for updating product_price_history table when
product price change in product table.
Code:
DELIMITER $$
USE `1905`$$
DROP TRIGGER /*!50032 IF EXISTS */ `history_trigger`$$
CREATE
/*!50017 DEFINER = 'root'@'localhost' */
TRIGGER `history_trigger` AFTER UPDATE ON `producttable`
FOR EACH ROW BEGIN
INSERT INTO product_price_history (product_no,old_price,new_price) VALUES
(old.product_no,old.product_price,new.product_price);
END$$
DELIMITER ;

Output:

196470307005 27

You might also like