Windows上的MySQLUDF开发_PHP教程
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Windows上的MySQLUDF开发_PHP教程,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1887字,纯文字阅读大概需要3分钟。
内容图文
![Windows上的MySQLUDF开发_PHP教程](/upload/InfoBanner/zyjiaocheng/179/024e2113c0af48c7a70a9469be1d2de4.jpg)
似乎发现是我搞错了,MySQL的技术支持人员给了非常完美的解答,同大家分享
一下。下边是原文回复 :)
Sorry this isn't a bug.
Below I pasted a sample I did sometime ago for another user:
Ok. Assuming you have VC and the source distribution and a server
running,
I will create a UDF that returns a name:
Note: the sample is ugly, but the purpose here is to show you how
to handle the UDF.
- Open the mysqld.dsw workspace.
- Add New project to the workspace
- Project name: my_udf
- Select Win32 Dynamic-Link Library
- Click OK
- Select An Empty DLL project
- Click Finish
- Click OK
- Add a new file called my_udf.cpp to the project:
#include
#include
#include
extern "C" {
char *my_name(UDF_INIT *initid, UDF_ARGS *args, char *is_null,
char *error);
}
char *my_name(UDF_INIT *initid, UDF_ARGS *args, char *is_null,
char *error)
{
char * me = "my name";
return me;
}
- Type Ctrl N for to create a new file.
- Select text type
- File name: my_udf.def
- Edit the above file with the below contents:
LIBRARY UDF_EXAMPLE
DESCRIPTION 'Example Using UDF with VC '
VERSION 1.0
EXPORTS
my_name
- Right Click the my_udf project and select Settings
- Click the C/C tab
- Select General in the Category Combo
- Add the macro HAVE_DLOPEN to the PreProcessor definition
- Select Preprocessor in the Category Combo
- Add the include path to the text box: Additional Include directories
e.g: ../include
- Press F7 for to build the DLL.
- Copy the my_udf.dll to the environment path directory:
winntsystem32 for example.
- Start the mysql client and issue:
C:mysql-udfin>mysql -uroot -p
http://www.bkjia.com/PHPjc/631130.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/631130.htmlTechArticle曾以为Windows版本的MySQL存在不能使用UDF的BUG诸提交了一个bug报告。不过 似乎发现是我搞错了,MySQL的技术支持人员给了非常完美的解答,同...
内容总结
以上是互联网集市为您收集整理的Windows上的MySQLUDF开发_PHP教程全部内容,希望文章能够帮你解决Windows上的MySQLUDF开发_PHP教程所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。