Click here to Skip to main content
15,885,914 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Sir,

send me the answer for this C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
Posted
Comments
Stephen Wiria 27-Jul-11 10:26am    
I believe that are 2 different things to achieve. One part is connecting/accesing MySQL, and the other one is doing DML (INSERT) and DDL (GRANT)

you need to have mysql library to connect mysql database http://www.mysql.com/downloads/mysql/[^]
 
Share this answer
 
Use have to use GRANT Syntax[^] and use a syntax like

GRANT INSERT ON db2.invoice TO 'jeffrey'@'localhost'

This will allow user 'jeffrey' only to INSERT data in table 'invoice'
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900