怎样在main中运行mysqld.exe的同时执行其它操作

Hughen 2013-02-17 08:55:04
我有一个程序需要先运行了mysqld.exe,但是mysqld.exe是一个服务类进程,所以没法得到它的return值。
我的程序需要运行mysqld.exe之后就执行其它操作,求解该如何实现?
(QProcess无法完成,start之后,一直停留在mysqld.exe上面)
...全文
136 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Hughen 2013-02-19
  • 打赏
  • 举报
回复
引用 1 楼 openXMPP 的回复:
可以试试以下方法: 1) 原来的进程fork,子进程调用mysql,父进程继续执行其他操作 2) bool QProcess::startDetached ( const QString & program ) [static] This is an overloaded function. Starts the program program in……
mysqld.exe就是后台运行,用fork怎么弄? 有点蒙了……
乔巴好萌 2013-02-18
  • 打赏
  • 举报
回复
可以试试以下方法: 1) 原来的进程fork,子进程调用mysql,父进程继续执行其他操作 2) bool QProcess::startDetached ( const QString & program ) [static] This is an overloaded function. Starts the program program in a new process. program is a single string of text containing both the program name and its arguments. The arguments are separated by one or more spaces. The program string can also contain quotes, to ensure that arguments containing spaces are correctly supplied to the new process. 3)如果是linux平台,可以考虑放在后台运行。 mysql & 不过看楼主描述貌似是windows平台

16,215

社区成员

发帖
与我相关
我的任务
社区描述
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
社区管理员
  • Qt
  • 亭台六七座
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧