查找并打印mysql pid [英] Finding and printing mysql pid

查看:91
本文介绍了查找并打印mysql pid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用C ++代码查找和打印mysql pid文件?

How can I find and print a mysql pid file using C++ code?

推荐答案

PID文件的名称存储在MySQL全局系统变量.使用可用的数据库API之一查询变量值,然后使用常规的C ++文件类打开和读取文件.
The name of the PID file is stored in the MySQL global system variable pid_file. Use one of the available database APIs to query the variable value, then use the normal C++ file classes to open and read the file.


1.找出文件的存储位置.
2.解码文件的内容.
3.打印结果.
1. Find out where the file is stored.
2. Decode the contents of the file.
3. Print the results.


该怎么做:如果环境变量的名称为pid_file,则使用GetEnvironmentVariable()函数来获取相应的值(假设该值是文件的路径). ,然后将其打印出来.
这是参考书 GetEnvironmentVariable(),并且有一些示例可供使用更改环境变量.
谢尔盖·吉普林(Sergey Chepurin).
How about that: If the name of the environment variable is pid_file use GetEnvironmentVariable() function to acquire the corresponding value where suppose to be path to the file, and then print it out.
Here is the reference GetEnvironmentVariable() and there are samples to use Changing Environment Variables.
Sergey Chepurin.


这篇关于查找并打印mysql pid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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