0
MySQL Tutorial By:  John Bouchard II Bruce Harris
Installing MySQL <ul><li>   Download MySQL 4.0.17 at:  </li></ul><ul><li>http://www.mysql.com/get/Downloads/MySQL-4.0/mys...
<ul><li>Once installation is complete, go to your autoexec.bat file </li></ul><ul><li>and put:  SET MYSQL_HOME=C:mysql </l...
Connecting to the MySQL Server <ul><li>SYNTAX:  mysql -h host -u user -p  </li></ul><ul><li><< EXAMPLE >> </li></ul><ul><l...
Changing “ROOT” password <ul><li>   GET USER FIRST:  </li></ul><ul><li>C:mysqlbin> mysql -u root mysql  </li></ul><ul><li...
Interfacing with MySQL Server <ul><li>The command-line is too cumbersome, we need a GUI!! </li></ul><ul><li>Enter the  MyS...
<ul><li>Open  Control Center and Register your MySQL Server </li></ul><ul><li>NAME:  Any name you want </li></ul><ul><li>H...
Hack the GUI on your own time!
Interfacing with Java: Important Points <ul><li>Use ConnectorJ  “JDBC Driver” </li></ul><ul><li>Include  mysql-connector-j...
Interfacing with Java: Example Code
 
Upcoming SlideShare
Loading in...5
×

Mysql

772

Published on

For beginners

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
772
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
22
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Mysql"

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

    Clipping is a handy way to collect important slides you want to go back to later.

×