我使用PHP MySQLi连接MySQL,有时做查询我得到错误:
"权限被拒绝"错误代码:2002.
奇怪的是,它发生在不同的查询中,完全不可预测.例如,在前两次正确执行后,它可能发生在第三个查询上.
我知道这不是MySQL的问题,因为我将它从一个服务器移动到另一个服务器,问题仍然存在.很可能是PHP的问题或PHP和MySQL服务器之间的互连(它们在不同的机器上)
有人有想法吗?
编辑:
查询什么获得"权限被拒绝"工作,如果我重新启动脚本 - 它不是权限问题
错误:
[23-Apr-2011 19:00:02] PHP警告:mysqli :: mysqli()[mysqli.mysqli]:[2002]权限被拒绝(尝试通过tcp连接://xxx.xxx.xxx.xxx:3306 )在/home/.../DB.php第19行
[23-Apr-2011 19:00:02] PHP警告:mysqli :: mysqli()[mysqli.mysqli] :( HY000/2002):权限被拒绝在第19行的/home/.../DB.php中
#1 Lua:
local test = Test();
Run Code Online (Sandbox Code Playgroud)
#2 C:
//creating "lua's test"
luaL_newmetatable(L, "someTable");
lua_userdata *userData = (lua_userdata *)lua_newuserdata(L, sizeof(lua_userdata));
luaL_getmetatable(L, "someTable");
lua_setmetatable(L, -2);
Run Code Online (Sandbox Code Playgroud)
#3 Lua:
function test.newMethod()
end
Run Code Online (Sandbox Code Playgroud)
#4 C:
//this part is not executed from Lua
//what i have to have here from #2 to call "test.newMethod" and how to call it?
//if userdata would be on stack i guess i could:
luaL_getmetafield (L, 1, "newMethod");
lua_call(L, 0, 0);
//but because this part is not executed by Lua call …
Run Code Online (Sandbox Code Playgroud)