如何使用C程序连接mysql [英] How to connect mysql using c program

查看:53
本文介绍了如何使用C程序连接mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,

请将此C/C ++程序的答案发送给我,以将用户添加到MySQL.应该只允许用户插入"到给定的数据库.

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.

推荐答案

您需要具有mysql库才能连接mysql数据库http://www.mysql.com/downloads/mysql/ [
you need to have mysql library to connect mysql database http://www.mysql.com/downloads/mysql/[^]


使用必须使用
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''


这篇关于如何使用C程序连接mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆