Navigation Bar

Thursday, October 9, 2025

MYSQL database installation

 Download the latest version of mysql database from the site below

Mysql Community Downloads

or an earlier version from the mysql archive site link below

Mysql Product Archives

Before starting the installation you need to make sure that any previous installation of the mysql database is completely removed, including the MYSQL service.

Otherwise you will get errors like

C:\Windows\system32>mysql -u root -p
Enter password: *****
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)


Now click on the msi file downloaded to begin the setup.




























If you want to change default path of the InnoDB datafile click on Modify









Based on the nature of your data processing you can use DSS or OLTP or a manual configuration
For my project I have selected OLTP







Select a standard character set





















If you get an error like this it means your previous setup of mysql running on port 3306 has not been completely removed. The service should also be removed as shown in the slides below.


Run the msi file and click on Remove








Run the msi file






After removing the existing service can reconfigure a new service as below.
Do a fresh installation as per the steps given above.

Now you will get a screen to set a new passwoard and no tab for current password which was the case in the earlier slide.




Now the service gets created successfully and in services.msc ti will show as running.






Now on the command prompt you can login to mysql with the root user and password set during the installation and type show databases command to see the existing mysql databases.



Now for the struts getquote project we create the stocks database, stocks table and insert data into the table as below.


mysql> create database stocks;
Query OK, 1 row affected (0.00 sec)

mysql> use stocks;
Database changed

mysql> CREATE TABLE STOCKS
    -> (
    ->   symbol  varchar(15)  not null primary key,
    ->   price   double not null
    -> );
Query OK, 0 rows affected (0.11 sec)

mysql> insert into stocks values ("SUNW", 78.00);
Query OK, 1 row affected (0.05 sec)

mysql> insert into stocks values ("YHOO", 24.45);
Query OK, 1 row affected (0.11 sec)

mysql> insert into stocks values ("MSFT", 3.24);
Query OK, 1 row affected (0.08 sec)

References 

God's Word for the day
Who pities a snake charmer when he is bitten,
  or all those who go near wild animals?
So no one pities a person who associates with a sinner
  and becomes involved in other's sins.
He stands by you for a while,
  but if you falter he will not be there.
Sirach 12:13-15

Concerning Oaths 
Again you have heard that it was said to those of ancient times
  'You shall not swear falsely, but carry out the vows you have made to the Lord.'
But I say to you, Do not swear at all,
  Either by heaven for it is the throne of God,
Or by the Earth for it is His footstool,
  Or by Jerusalem, for it is the city of the great King.
And do not swear by you head, for you cannot make one hair white or black.
  Let your word be 'Yes, Yes' or 'No, No';
Anything more than this comes from the evil one.

Mathew 5:33-37

No comments:

Post a Comment