Mysql api c sql2
This presentation is the property of its rightful owner.
Sponsored Links
1 / 13

MySQL API( c ) & SQL2 PowerPoint PPT Presentation


  • 78 Views
  • Uploaded on
  • Presentation posted in: General

MySQL API( c ) & SQL2. [email protected] 강동훈. Contents. Overview How to use MySQL(SQL2) How to use MySQL API (in C). Overview. SQL Structured Query Language based on the relational database. Data definition Data manipulation Query MySQL. Connect to MySQL Server

Download Presentation

MySQL API( c ) & SQL2

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Mysql api c sql2

MySQL API( c ) & SQL2

[email protected]

강동훈


Contents

Contents

  • Overview

  • How to use MySQL(SQL2)

  • How to use MySQL API (in C)


Overview

Overview

  • SQL

    • Structured Query Language

    • based on the relational database.

    • Data definition

    • Data manipulation

    • Query

  • MySQL


How to use mysql 1

Connect to MySQL Server

shell> mysql -h host -u user -p <사용할 DB> <Enter>

password: ********

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 459 to server version: 3.22.20a-log

Type 'help' for help.

mysql>

How to use MySQL #1


How to use mysql 2

How to use MySQL #2

  • Data Definition 1

    mysql> SHOW DATABASES;


How to use mysql 3

How to use MySQL #3

  • Data Definition 2

mysql> CREATE DATABASE docmanager;

mysql> USE docmanager

Database changed

mysql> SHOW TABLES;

Empty set (0.00 sec)

mysql>

형식 : CREATE DATABASE <DATABASE NAME>;

USE <사용할 DB NAME>


How to use mysql 4

Data definition 3

How to use MySQL #4

mysql> CREATE TABLE docmanager (title VARCHAR(40), description

-> VARCHAR(40),file_name VARCHAR(20),

-> enrolled DATE, updated DATE, owner VARCHAR(20));

(CF) desc

형식 : CREATE TABLE 테이블명(컬럼의 형식);


How to use mysql 5

How to use MySQL #5

  • Data Manipulation 1

    mysql> INSERT INTO docmanager

    -> VALUES(‘MySQL Seminar', ‘MySQL?', ‘MySQL.ppt', ‘2000-07-

    ‘> 04',’2000-07-05’, ‘please’);

    mysql> UPDATE docmanager SET updated=“2000-07-06" WHERE title=“MySQL Seminar";

    형식: INSERT INTO 테이블명 VALUES(컬럼의 데이터 값..);

    UPDATE 테이블명 SET 컬럼명 = 식,… [WHERE 조건];


How to use mysql 51

How to use MySQL #5

  • Data manipulation 2

    mysql> SELECT * FROM docmanager;

    mysql> SELECT * FROM docmanager WHERE owner = “please";

    mysql> SELECT owner FROM docmanager;

    형식: SELECT 컬럼명 … from 테이블명 [WHERE 조건];


How to use mysql api in c 1

Process

1.connect to SQL server

2.Quest Queries

3.manipulate result sets

How to use MySQL API(in C) #1


How to use mysql api in c 2

How to use MySQL API(in C) #2

Mysql_init()

Mysql_store_result()

Mysql_use_result()

Mysql_real_connect()

Mysql_fetch_row()

Mysql_query()

Mysql_real_query()

Mysql_free_result()

If result set exists(only to “SELECT” Query)

Mysql_close()


Mysql api c sql2

Gcc –g –o mysqlapiexample mysqlapiexample.c –L/usr/lib/mysql –lmysqlclient


How to use mysql api in c 4

How to use MySQL API(in C) #4

  • C API Function Description


  • Login