My SQL Introduction Outline My SQL Introduction Installation

  • Slides: 19
Download presentation
My. SQL Introduction

My. SQL Introduction

Outline • My. SQL Introduction & Installation • My. SQL Command-Line Tool • My.

Outline • My. SQL Introduction & Installation • My. SQL Command-Line Tool • My. SQL Workbench Introduction • My. SQL with Python • Code Example

My. SQL Introduction • Open Source (C/C++), Free • High Performance, Low Cost, High

My. SQL Introduction • Open Source (C/C++), Free • High Performance, Low Cost, High Reliability • LAMP (Linux+Apache+My. SQL+PHP) • Multi-OS Support (Windows, Linux, Mac. OS) • API Support (C/C++, C#, Python, PHP, Java)

My. SQL Installation • OS: Ubuntu Linux • Official Site: http: //dev. mysql. com/downloads/mysql/

My. SQL Installation • OS: Ubuntu Linux • Official Site: http: //dev. mysql. com/downloads/mysql/ • Select Platform and download a deb package • Latest version: My. SQL Community Server 5. 7. 11 • Using apt-get (Recommanded) • sudo apt-get install mysql-server mysql-client • Set a password for root account • For Windows, don’t forget to set Windows system PATH environment variable

My. SQL Command-Line Tool • Login • mysql –u<username> –p<password> • mysql –uroot –p

My. SQL Command-Line Tool • Login • mysql –u<username> –p<password> • mysql –uroot –p 123123 • Logout • exit

My. SQL Command-Line Tool • Input your SQL after “mysql>”

My. SQL Command-Line Tool • Input your SQL after “mysql>”

My. SQL Command-Line Tool

My. SQL Command-Line Tool

My. SQL Workbench Installation • A visual tool for My. SQL • Official Site:

My. SQL Workbench Installation • A visual tool for My. SQL • Official Site: http: //dev. mysql. com/downloads/workbench/ • Select Platform and download a deb package • Latest version: My. SQL Workbench 6. 3. 6 • Using apt-get (Recommanded) • sudo apt-get install mysql-workbench

My. SQL Workbench Login

My. SQL Workbench Login

My. SQL Workbench Login • Hostname, Port, Username, Password

My. SQL Workbench Login • Hostname, Port, Username, Password

My. SQL Workbench UI

My. SQL Workbench UI

My. SQL Workbench Usage

My. SQL Workbench Usage

My. SQL Workbench ER Model & Forward Engineering • File->New Model->Add Diagam • File->Export

My. SQL Workbench ER Model & Forward Engineering • File->New Model->Add Diagam • File->Export • Get SQL Script

DB example create table students( create table courses( sid int, cid int, name varchar(40),

DB example create table students( create table courses( sid int, cid int, name varchar(40), cname varchar(40), dept varchar(40), spring int, age int, teacher varchar(40), primary key(sid) primary key(cid) ); create table sc ( sid int references students(sid) ON DELETE CASCADE ON UPDATE CASCADE, cid int , semester int, cname varchar(40), grade int );

My. SQL with Python • Install My. SQLdb Lib for Python • sudo apt-get

My. SQL with Python • Install My. SQLdb Lib for Python • sudo apt-get install python-mysqldb

Web. py • Web. py is a web framework for Python • http: //webpy.

Web. py • Web. py is a web framework for Python • http: //webpy. org/ • Installation • sudo apt-get install python-pip • sudo pip install web. py • Code example • Special Database API (part of web. py)

Blog

Blog

Other References • https: //en. wikipedia. org/wiki/My. SQL • http: //www. runoob. com/mysql-install. html

Other References • https: //en. wikipedia. org/wiki/My. SQL • http: //www. runoob. com/mysql-install. html • http: //blog. csdn. net/ithomer/article/details/51318 63 • http: //www. runoob. com/pythonmysql. html