1 / 20

MySQL An Open Source DBMS

MySQL An Open Source DBMS. 資訊工程導論 2009/6/8. Outline. 資料庫簡介 MySQL 簡介 管理 MySQL 的介面工具 - phpMyAdmin MySQL 與 PHP 的關係 超好用架站工具 - AppServ 幾個 PHP&MySQL 的應用 + Demo 時間. 資料庫簡介. 何謂資料庫 ? 存放資料的地方 (The repository of data). Data. Data. Data. Database. 資料庫簡介. 何謂資料庫管理系統 ?

sylvie
Télécharger la présentation

MySQL An Open Source DBMS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MySQLAn Open Source DBMS 資訊工程導論 2009/6/8 RTLAB

  2. Outline • 資料庫簡介 • MySQL簡介 • 管理MySQL的介面工具 - phpMyAdmin • MySQL與PHP的關係 • 超好用架站工具 - AppServ • 幾個PHP&MySQL的應用 + Demo時間

  3. 資料庫簡介 • 何謂資料庫 ? • 存放資料的地方 (The repository of data) Data Data Data Database

  4. 資料庫簡介 • 何謂資料庫管理系統 ? • 資料庫管理系統 (DBMS, DataBase Management System) • 對資料庫作查詢、新增、刪除、修改的軟體 Database Users DBMS

  5. 資料庫簡介 • 操作資料庫的共通語言 • SQL (Structured Query Language) SQL 語言 Database SELECT * FROM mytable WHERE name LIKE ‘Peter%’ ORDER BY name DBMS

  6. 資料庫簡介 • 關聯式資料庫 (Relational Database)

  7. 資料庫簡介 • 幾個有名的RDBMS • Microsoft SQL Server • 微軟大帝國的產品 + $ • Oracle Database • 甲骨文公司的產品 + $ • MySQL • Open Source + No $ • SQLite • Embedded System • Android

  8. MySQL 簡介 • MySQL是什麼 ? • RDBMS • Relational Database • 是一個Open Source的自由軟體 (GPL) • 習慣上唸成 “my-S-Q-L”,而非 “my-Sequel” Database DBMS

  9. MySQL AB MySQL 簡介 • MySQL 的歷史 2008/1/16 1995/5/23 2009/4/20

  10. MySQL 簡介 • MySQL 的特色 • 目前最新穩定版為5.4 • 穩定 & 快速 • 使用C和C++編寫,並使用了多種編譯器進行測試,保證可移植性 • 跨平台:Unix, MS-Windows, MacOS • 有 multi-threading (多執行緒) 能力 • 提供 C/C++, Java, PHP, Perl, Python …各種應用程式開發介面 (API)

  11. 管理MySQL的工具 • 使用命令列工具管理MySQL數據庫(命令mysql 和 mysqladmi) • 從MySQL的網站下載圖形管理工具MySQL Administrator和MySQL Query Browser • phpMyAdmin

  12. 管理MySQL的工具 • phpMyAdmin • MySQL資料庫管理工具 • 以PHP語言撰寫而成 • Web-based • Demo

  13. MySQL與PHP的關係 <html> <head></head> <body> <?php echo date(“Y-m-d”) ?> </body> </html> 要求網頁,如index.php PHP 直譯器 回應網頁(HTML) IE、FireFox 、Chrome Web Server Database <html> <head></head> <body> 2008-04-12 </body> </html> MySQL

  14. MySQL與PHP的關係 • PHP內建與MySQL有關之函數 • mysql_connect()與MySQL建立資料庫連線 • mysql_pconnect() 與MySQL建立資料庫持續連線 • mysql_select_db() 選擇資料庫 • mysql_create_db()建立資料庫 • mysql_close()關閉與資料庫連線 • mysql_query()執行SQL指令 • mysql_num_rows() 查詢結果總筆數 • mysql_fetch_array() 將查詢結果以陣列表示 • mysql_fetch_row() 將查詢結果以變數表示 • mysql_insert_id() 前一筆紀錄新增時的ID值 • mysql_error() MySQL錯誤訊息 • mysql_errno()MySQL錯誤訊息編號

  15. MySQL與PHP的關係 • 連接資料庫 • mysql_pconnect (server, username, password) • //持續性的資料庫連接例如: • $conn = mysql_pconnect (‘localhost’,’root’,’1234’); • mysql_connect (server, username, password) • //非持續性的資料庫連接例如: • $conn = mysql_connect (‘localhost’,’root’,’1234’);

  16. MySQL與PHP的關係 • 選擇資料庫 • mysql_select_db(database_name , [link_id]) • 例如: • mysql_select_db(“test_db");

  17. MySQL與PHP的關係 • 執行查詢 • mysql_query (string query ,[ resource link_id ]) • 例如: • $result = mysql_query("select * from user ");

  18. 超好用架站工具 • AppServ • http://www.appservnetwork.com/ • 最新版本 • 2.5.10 • Apache 2.2.8 • MySQL 5.0.51b • PHP 5.2.6 • phpMyAdmin-2.10.3 • 2.6.0

  19. 幾個PHP&MySQL的應用 • 個人部落格 – WordPress • http://wordpress.org/ • 社群論壇 – phpBB • http://www.phpbb.com/ • Wiki共筆 – MediaWiki • http://www.mediawiki.org/wiki/MediaWiki

  20. Demo時間

More Related