Write a C/C++ program to add a user to MySQL. The user should
be permitted to only "INSERT" into the given database

Answers were Sorted based on User's Feedback



Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT&qu..

Answer / venkat

The C API code is distributed with MySQL. It is included in
the mysqlclient library and enables C programs to access a
database.

Many of the clients in the MySQL source distribution are
written in C. If you are looking for examples that
demonstrate how to use the C API, take a look at these
clients. You can find these in the client directory in the
MySQL source distribution.

Most of the other client APIs (all except Connector/J and
Connector/Net) use the mysqlclient library to communicate
with the MySQL server. This means that, for example, you can
take advantage of many of the same environment variables
that are used by other client programs, because they are
referenced from the library. See Chapter 4, MySQL Programs,
for a list of these variables.

The client has a maximum communication buffer size. The size
of the buffer that is allocated initially (16KB) is
automatically increased up to the maximum size (the maximum
is 16MB). Because buffer sizes are increased only as demand
warrants, simply increasing the default maximum limit does
not in itself cause more resources to be used. This size
check is mostly a check for erroneous statements and
communication packets.

The communication buffer must be large enough to contain a
single SQL statement (for client-to-server traffic) and one
row of returned data (for server-to-client traffic). Each
thread's communication buffer is dynamically enlarged to
handle any query or row up to the maximum limit. For
example, if you have BLOB values that contain up to 16MB of
data, you must have a communication buffer limit of at least
16MB (in both server and client). The client's default
maximum is 16MB, but the default maximum in the server is
1MB. You can increase this by changing the value of the
max_allowed_packet parameter when the server is started. See
Section 7.9.2, “Tuning Server Parameters”.

The MySQL server shrinks each communication buffer to
net_buffer_length bytes after each query. For clients, the
size of the buffer associated with a connection is not
decreased until the connection is closed, at which time
client memory is reclaimed.

For programming with threads, see Section 19.8.16.2, “How to
Write a Threaded Client”. For creating a standalone
application which includes the "server" and "client" in the
same program (and does not communicate with an external
MySQL server), see Section 19.7, “libmysqld, the Embedded
MySQL Server Library”.

Note
If, after an upgrade, you experience problems with compiled
client programs, such as Commands out of sync or unexpected
core dumps, you probably have used old header or library
files when compiling your programs. In this case, you should
check the date for your mysql.h file and libmysqlclient.a
library to verify that they are from the new MySQL
distribution. If not, recompile your programs with the new
headers and libraries. Recompilation might also be necessary
for programs compiled against the shared client library if
the library major version number has changed (for example
from libmysqlclient.so.15 to libmysqlclient.so.16.

Is This Answer Correct ?    14 Yes 9 No

Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT&qu..

Answer / jollyvel

i dont know please help

Is This Answer Correct ?    14 Yes 17 No

Post New Answer

More C Interview Questions

how to impliment 2 or more stacks in a single dimensional array ?

1 Answers   iFlex, Microsoft,


what is the difference between definition and declaration? give me some examples.

2 Answers   TCS,


What is signed and unsigned?

0 Answers  


write a function that accepts an array A with n elements and array B with n-1 elements. Find the missing one in array B,with an optimized manner?

2 Answers   Zensar,


Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers

0 Answers  






write a c program to find the roots of a quadratic equation ax2 + bx + c = 0

11 Answers   CSC, St Marys, TATA,


How can you return multiple values from a function?

0 Answers  


a character variable can at a time store a) 1 character b) 8 characters c) 254 characters d) none of the above

3 Answers  


5. distance conversion: Convert a distance from miles to kilometers .there are 5280 feets per mile,12 inches per foot .2.54 centimeters per inch and 100000centimeters per kilometer

4 Answers  


#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; s1=s2; printf("%s",s1); } Find the output

5 Answers   CitiGroup,


Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

0 Answers  


Write a program using two-dimensional array that lists the odd numbers and even numbers separately in a 12 input values.

1 Answers  


Categories