SlideShare a Scribd company logo
MySQL Tutorial
Installing MySQL
 Download MySQL 4.0.17 at:
http://www.mysql.com/get/Downloads/MySQL-4.0/mysql-4.0.17-win.zip/from/http://mysql.orst.edu/
 Unzip “mysql-4.0.1-win.zip” and execute “setup.exe”
 Choose a directory, select typical install options.
 Once installation is complete, go to your autoexec.bat file
and put: SET MYSQL_HOME=C:mysql
SET PATH =%MYSQL_HOME%bin;%PATH%
-where “C:mysql” is the location where you installed mysql.
 Once mysql is installed, and your variables are setup,
you need to install the mysql server “service”. To do this type:
C:mysqlbin> mysqld --install //installs the service
C:mysqlbin> NET START MYSQL //start the mysql server
Connecting to the MySQL Server
• SYNTAX: mysql -h host -u user -p
<< EXAMPLE >>
C:mysqlbin> mysql –h localhost –u root –p
NOTE: THE DEFAULT PASSWORD FOR ROOT IS BLANK !!!
Changing “ROOT” password
 GET USER FIRST:
C:mysqlbin> mysql -u root mysql
 CHANGE PASSWORD SYNTAX:
mysql> UPDATE user SET Password=PASSWORD('new_password')
WHERE user='root';
mysql> FLUSH PRIVILEGES;
DON NOT FORGET THE “ ; “ semi-colon
Interfacing with MySQL Server
• The command-line is too cumbersome, we need a GUI!!
• Enter the MySQL Control Center
• Download at:
http://www.mysql.com/get/Downloads/MySQLCC/mysqlcc-
0.9.4-win32.zip/from/http://mysql.orst.edu/
• Unzip mysqlcc-0.9.4-win32.zip and install:
• Open Control Center and Register your MySQL Server
• NAME: Any name you want
• HOST: DNS NAME OR IP-ADDRESS of MySQL SERVER
• USERNAME: Usually root
• PASSWORD: Leave blank, UNLESS you changed it.
Hack the GUI on your own time!
Interfacing with Java: Important Points
• Use ConnectorJ “JDBC Driver”
• Include mysql-connector-java-3.0.10-stable-bin.jar in your
java project
• Import com.mysql.jdbc.Driver;
• Get to know the java.sql.* Package!
Understand “DriverManager” and its relationship with a
“Connection”.
OTHER CLASSES OF USE:
ResultSet - The format Data is retrieved from a Database.
Statement - Used to query a Database for a ResultSet.
CallStatement - Execute a StoredProcedure in the database to
obtain a ResultSet.
Interfacing with Java: Example Code
My sql essentials

More Related Content

What's hot

How to install and configure lamp (linux,apache mysql mariadb,php) with jooml...
How to install and configure lamp (linux,apache mysql mariadb,php) with jooml...How to install and configure lamp (linux,apache mysql mariadb,php) with jooml...
How to install and configure lamp (linux,apache mysql mariadb,php) with jooml...CloudMinister Technologies Pvt. Ltd
 
MySql cheat sheet
MySql cheat sheetMySql cheat sheet
MySql cheat sheetLam Hoang
 
Apache ds building_from_source
Apache ds building_from_sourceApache ds building_from_source
Apache ds building_from_sourcemervettt
 
Visual Programming Framework for Unity - UniFlow のご紹介
Visual Programming Framework for Unity - UniFlow のご紹介Visual Programming Framework for Unity - UniFlow のご紹介
Visual Programming Framework for Unity - UniFlow のご紹介Mori Tetsuya
 
Elastic Beanstalk 이용한 Django 배포
Elastic Beanstalk 이용한 Django 배포 Elastic Beanstalk 이용한 Django 배포
Elastic Beanstalk 이용한 Django 배포 Kim SeokYoung
 
Debian quality assurance systems – What can MariaDB developers learn from them?
Debian quality assurance systems – What can MariaDB developers learn from them?Debian quality assurance systems – What can MariaDB developers learn from them?
Debian quality assurance systems – What can MariaDB developers learn from them?Otto Kekäläinen
 
Setting up MySQL Replication Cluster in Kubernetes
Setting up MySQL Replication Cluster in KubernetesSetting up MySQL Replication Cluster in Kubernetes
Setting up MySQL Replication Cluster in KubernetesElizabeth Yu, MBA
 
Resources and providers chef conf 2013
Resources and providers chef conf 2013Resources and providers chef conf 2013
Resources and providers chef conf 2013rosekolodny
 
Bugzilla installation guide
Bugzilla installation guideBugzilla installation guide
Bugzilla installation guideusha kannappan
 
MariaDB in Debian and Ubuntu: The next million users
MariaDB in Debian and Ubuntu: The next million usersMariaDB in Debian and Ubuntu: The next million users
MariaDB in Debian and Ubuntu: The next million usersOtto Kekäläinen
 

What's hot (20)

Chef
ChefChef
Chef
 
How to install and configure lamp (linux,apache mysql mariadb,php) with jooml...
How to install and configure lamp (linux,apache mysql mariadb,php) with jooml...How to install and configure lamp (linux,apache mysql mariadb,php) with jooml...
How to install and configure lamp (linux,apache mysql mariadb,php) with jooml...
 
Elastic search
Elastic searchElastic search
Elastic search
 
Links todwnload
Links todwnloadLinks todwnload
Links todwnload
 
Lamp introduction in Fedora
Lamp introduction in FedoraLamp introduction in Fedora
Lamp introduction in Fedora
 
Intalacion de owncloud
Intalacion de owncloudIntalacion de owncloud
Intalacion de owncloud
 
MySql cheat sheet
MySql cheat sheetMySql cheat sheet
MySql cheat sheet
 
Maven: Mule esb plugin
Maven: Mule esb pluginMaven: Mule esb plugin
Maven: Mule esb plugin
 
L5 swagger
L5 swaggerL5 swagger
L5 swagger
 
Apache ds building_from_source
Apache ds building_from_sourceApache ds building_from_source
Apache ds building_from_source
 
Visual Programming Framework for Unity - UniFlow のご紹介
Visual Programming Framework for Unity - UniFlow のご紹介Visual Programming Framework for Unity - UniFlow のご紹介
Visual Programming Framework for Unity - UniFlow のご紹介
 
Elastic Beanstalk 이용한 Django 배포
Elastic Beanstalk 이용한 Django 배포 Elastic Beanstalk 이용한 Django 배포
Elastic Beanstalk 이용한 Django 배포
 
Mysql
Mysql Mysql
Mysql
 
Sql installation
Sql installationSql installation
Sql installation
 
Debian quality assurance systems – What can MariaDB developers learn from them?
Debian quality assurance systems – What can MariaDB developers learn from them?Debian quality assurance systems – What can MariaDB developers learn from them?
Debian quality assurance systems – What can MariaDB developers learn from them?
 
Jones_Lamp_Tutorial
Jones_Lamp_TutorialJones_Lamp_Tutorial
Jones_Lamp_Tutorial
 
Setting up MySQL Replication Cluster in Kubernetes
Setting up MySQL Replication Cluster in KubernetesSetting up MySQL Replication Cluster in Kubernetes
Setting up MySQL Replication Cluster in Kubernetes
 
Resources and providers chef conf 2013
Resources and providers chef conf 2013Resources and providers chef conf 2013
Resources and providers chef conf 2013
 
Bugzilla installation guide
Bugzilla installation guideBugzilla installation guide
Bugzilla installation guide
 
MariaDB in Debian and Ubuntu: The next million users
MariaDB in Debian and Ubuntu: The next million usersMariaDB in Debian and Ubuntu: The next million users
MariaDB in Debian and Ubuntu: The next million users
 

Viewers also liked

Game design for beginners
Game design for beginnersGame design for beginners
Game design for beginnersMinhaj Kazi
 
Unreal gaming design kit basic concepts
Unreal gaming design kit  basic conceptsUnreal gaming design kit  basic concepts
Unreal gaming design kit basic conceptsMinhaj Kazi
 
Android development-workshop-v2-1228043706544191-8
Android development-workshop-v2-1228043706544191-8Android development-workshop-v2-1228043706544191-8
Android development-workshop-v2-1228043706544191-8Minhaj Kazi
 
Android Development project
Android Development projectAndroid Development project
Android Development projectMinhaj Kazi
 
Extracts from Game Design Document
Extracts from Game Design DocumentExtracts from Game Design Document
Extracts from Game Design DocumentMichael Crosby
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
 

Viewers also liked (8)

Design Document
Design DocumentDesign Document
Design Document
 
Game design for beginners
Game design for beginnersGame design for beginners
Game design for beginners
 
Intro to my sql
Intro to my sqlIntro to my sql
Intro to my sql
 
Unreal gaming design kit basic concepts
Unreal gaming design kit  basic conceptsUnreal gaming design kit  basic concepts
Unreal gaming design kit basic concepts
 
Android development-workshop-v2-1228043706544191-8
Android development-workshop-v2-1228043706544191-8Android development-workshop-v2-1228043706544191-8
Android development-workshop-v2-1228043706544191-8
 
Android Development project
Android Development projectAndroid Development project
Android Development project
 
Extracts from Game Design Document
Extracts from Game Design DocumentExtracts from Game Design Document
Extracts from Game Design Document
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 

Similar to My sql essentials

MySQL 8.0.21 - New Features Summary
MySQL 8.0.21 - New Features SummaryMySQL 8.0.21 - New Features Summary
MySQL 8.0.21 - New Features SummaryOlivier DASINI
 
Build MySQL virtual enviroment
Build MySQL virtual enviromentBuild MySQL virtual enviroment
Build MySQL virtual enviromentTaras Vasylyuk
 
R hive tutorial supplement 2 - Installing Hive
R hive tutorial supplement 2 - Installing HiveR hive tutorial supplement 2 - Installing Hive
R hive tutorial supplement 2 - Installing HiveAiden Seonghak Hong
 
How to install wordpress on wampserver
How to install wordpress on wampserverHow to install wordpress on wampserver
How to install wordpress on wampservershreyakp
 
PHP environment setup installation
PHP environment setup installation PHP environment setup installation
PHP environment setup installation e-visionlabs
 
Bugzilla Installation Process
Bugzilla Installation ProcessBugzilla Installation Process
Bugzilla Installation ProcessVino Harikrishnan
 
Hdf installing-hdf
Hdf installing-hdfHdf installing-hdf
Hdf installing-hdfnmrrsc
 
Getting started with my sql
Getting started with my sqlGetting started with my sql
Getting started with my sqlWeb Sky
 
Creating a full stack web app with python, npm, webpack and react
Creating a full stack web app with python, npm, webpack and reactCreating a full stack web app with python, npm, webpack and react
Creating a full stack web app with python, npm, webpack and reactAngela Kristine Juvet Branaes
 
Serving Moodle Presentation
Serving Moodle PresentationServing Moodle Presentation
Serving Moodle Presentationwebhostingguy
 

Similar to My sql essentials (20)

Raj mysql
Raj mysqlRaj mysql
Raj mysql
 
instaling
instalinginstaling
instaling
 
instaling
instalinginstaling
instaling
 
instaling
instalinginstaling
instaling
 
instaling
instalinginstaling
instaling
 
MySQL 8.0.21 - New Features Summary
MySQL 8.0.21 - New Features SummaryMySQL 8.0.21 - New Features Summary
MySQL 8.0.21 - New Features Summary
 
Oracle autovue
Oracle autovueOracle autovue
Oracle autovue
 
Jffnms Manual
Jffnms ManualJffnms Manual
Jffnms Manual
 
Build MySQL virtual enviroment
Build MySQL virtual enviromentBuild MySQL virtual enviroment
Build MySQL virtual enviroment
 
R hive tutorial supplement 2 - Installing Hive
R hive tutorial supplement 2 - Installing HiveR hive tutorial supplement 2 - Installing Hive
R hive tutorial supplement 2 - Installing Hive
 
How to install wordpress on wampserver
How to install wordpress on wampserverHow to install wordpress on wampserver
How to install wordpress on wampserver
 
Mysql ppt
Mysql pptMysql ppt
Mysql ppt
 
PHP environment setup installation
PHP environment setup installation PHP environment setup installation
PHP environment setup installation
 
Bugzilla Installation Process
Bugzilla Installation ProcessBugzilla Installation Process
Bugzilla Installation Process
 
Hdf installing-hdf
Hdf installing-hdfHdf installing-hdf
Hdf installing-hdf
 
Getting started with my sql
Getting started with my sqlGetting started with my sql
Getting started with my sql
 
Set up dev environment
Set up dev environmentSet up dev environment
Set up dev environment
 
Creating a full stack web app with python, npm, webpack and react
Creating a full stack web app with python, npm, webpack and reactCreating a full stack web app with python, npm, webpack and react
Creating a full stack web app with python, npm, webpack and react
 
Serving Moodle Presentation
Serving Moodle PresentationServing Moodle Presentation
Serving Moodle Presentation
 
My sql administration
My sql administrationMy sql administration
My sql administration
 

Recently uploaded

Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Product School
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Alison B. Lowndes
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1DianaGray10
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...Product School
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2DianaGray10
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsVlad Stirbu
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform EngineeringJemma Hussein Allen
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxAbida Shariff
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesThousandEyes
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»QADay
 

Recently uploaded (20)

Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
 

My sql essentials

  • 2. Installing MySQL  Download MySQL 4.0.17 at: http://www.mysql.com/get/Downloads/MySQL-4.0/mysql-4.0.17-win.zip/from/http://mysql.orst.edu/  Unzip “mysql-4.0.1-win.zip” and execute “setup.exe”  Choose a directory, select typical install options.
  • 3.  Once installation is complete, go to your autoexec.bat file and put: SET MYSQL_HOME=C:mysql SET PATH =%MYSQL_HOME%bin;%PATH% -where “C:mysql” is the location where you installed mysql.  Once mysql is installed, and your variables are setup, you need to install the mysql server “service”. To do this type: C:mysqlbin> mysqld --install //installs the service C:mysqlbin> NET START MYSQL //start the mysql server
  • 4. Connecting to the MySQL Server • SYNTAX: mysql -h host -u user -p << EXAMPLE >> C:mysqlbin> mysql –h localhost –u root –p NOTE: THE DEFAULT PASSWORD FOR ROOT IS BLANK !!!
  • 5. Changing “ROOT” password  GET USER FIRST: C:mysqlbin> mysql -u root mysql  CHANGE PASSWORD SYNTAX: mysql> UPDATE user SET Password=PASSWORD('new_password') WHERE user='root'; mysql> FLUSH PRIVILEGES; DON NOT FORGET THE “ ; “ semi-colon
  • 6. Interfacing with MySQL Server • The command-line is too cumbersome, we need a GUI!! • Enter the MySQL Control Center • Download at: http://www.mysql.com/get/Downloads/MySQLCC/mysqlcc- 0.9.4-win32.zip/from/http://mysql.orst.edu/ • Unzip mysqlcc-0.9.4-win32.zip and install:
  • 7. • Open Control Center and Register your MySQL Server • NAME: Any name you want • HOST: DNS NAME OR IP-ADDRESS of MySQL SERVER • USERNAME: Usually root • PASSWORD: Leave blank, UNLESS you changed it.
  • 8. Hack the GUI on your own time!
  • 9. Interfacing with Java: Important Points • Use ConnectorJ “JDBC Driver” • Include mysql-connector-java-3.0.10-stable-bin.jar in your java project • Import com.mysql.jdbc.Driver; • Get to know the java.sql.* Package! Understand “DriverManager” and its relationship with a “Connection”. OTHER CLASSES OF USE: ResultSet - The format Data is retrieved from a Database. Statement - Used to query a Database for a ResultSet. CallStatement - Execute a StoredProcedure in the database to obtain a ResultSet.
  • 10. Interfacing with Java: Example Code