dbTalk Databases Forums  

C Access

comp.databases.mysql comp.databases.mysql


Discuss C Access in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
lalawawa
 
Posts: n/a

Default C Access - 06-23-2010 , 09:40 PM






2 questions:

- How do I access MySql from within a C/C++ program (without invoking
the unix shell, i.e. without calling "system" or "popen"?
- How do I tell MySql I want my database to be stored in a specific
location on my file system?

Reply With Quote
  #2  
Old   
Jerry Stuckle
 
Posts: n/a

Default Re: C Access - 06-23-2010 , 11:25 PM






lalawawa wrote:
Quote:
2 questions:

- How do I access MySql from within a C/C++ program (without invoking
the unix shell, i.e. without calling "system" or "popen"?
http://dev.mysql.com/doc/refman/5.5/...cfunction.html

Quote:
- How do I tell MySql I want my database to be stored in a specific
location on my file system?
http://dev.mysql.com/doc/refman/5.5/...all-mysql.html

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex (AT) attglobal (DOT) net
==================

Reply With Quote
  #3  
Old   
Gordon Burditt
 
Posts: n/a

Default Re: C Access - 06-23-2010 , 11:26 PM



Quote:
- How do I access MySql from within a C/C++ program (without invoking
the unix shell, i.e. without calling "system" or "popen"?
Link with libmysqlclient and code calls using the C or C++ API into
your program. See the section of the MySQL manual on the programming
APIs.

Quote:
- How do I tell MySql I want my database to be stored in a specific
location on my file system?
You don't really get fine-grained control over this. You can set
datadir (in my.cnf) to set the location of the whole tree of
databases. You can locate an individual (MyISAM) database elsewhere
by replacing a subdirectory of datadir with a symlink to a directory
placed where you want it to go. (Careful about preserving ownerships
and permissions if you do such a copy, and do it when the server
isn't running.)

Reply With Quote
  #4  
Old   
Axel Schwenke
 
Posts: n/a

Default Re: C Access - 06-24-2010 , 03:11 AM



lalawawa <usenet (AT) ccjj (DOT) info> wrote:
Quote:
- How do I access MySql from within a C/C++ program (without invoking
the unix shell, i.e. without calling "system" or "popen"?
There is a bunch of "connectors" available to use MySQL from many
programming languages. The C API (also known as libmysqlclient) is
used very often. Connector/C is just a freestanding implementation of
the same. The C++ API is from MySQL^WSun^WOracle, and Connector/C++
is a community project.

http://dev.mysql.com/doc/refman/5.1/...tors-apis.html

Quote:
- How do I tell MySql I want my database to be stored in a specific
location on my file system?
The datadir option has been named already. There are also options for
CREATE TABLE to put MyISAM files outside $datadir. And the shared
InnoDB tablespace can also be put outside the $datadir.

http://dev.mysql.com/doc/refman/5.1/...r-options.html
http://dev.mysql.com/doc/refman/5.1/...ate-table.html
http://dev.mysql.com/doc/refman/5.1/...arameters.html


XL

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.