我有一个MySql服务器的问题导致它一直冻结.在phpMyAdmin中,当发生这种情况时,我可以在"显示进程列表"中看到用户"未经验证的用户"的许多进程,其中命令为"connect",状态为"从网络读取".
数据库正在使用InnoDB,但我也使用一个运行MyISAM的表来执行全文搜索.服务器有大约4GB的内存,使用不到500MB.
我一直在使用来自MySql的慢查询日志来查找不使用索引的查询.我还认为我需要对服务器变量进行一些更改/调整.
我真的可以在这里使用一些帮助,因此我在这里发布SHOW GLOBAL STATUS和SHOW GLOBAL VARIABLES,也许你可以给我一些如何设置变量的想法?
当前显示全球状况:
Variable_name Value
Aborted_clients 730
Aborted_connects 35
Binlog_cache_disk_use 0
Binlog_cache_use 0
Binlog_stmt_cache_disk_use 0
Binlog_stmt_cache_use 0
Bytes_received 31558148370
Bytes_sent 556410688609
Com_admin_commands 4565
Com_assign_to_keycache 0
Com_alter_db 0
Com_alter_db_upgrade 0
Com_alter_event 0
Com_alter_function 0
Com_alter_procedure 0
Com_alter_server 0
Com_alter_table 3
Com_alter_tablespace 0
Com_analyze 0
Com_begin 168
Com_binlog 0
Com_call_procedure 0
Com_change_db 26791502
Com_change_master 0
Com_check 0
Com_checksum 0
Com_commit 0
Com_create_db 0
Com_create_event 0
Com_create_function 0
Com_create_index 0
Com_create_procedure 0
Com_create_server 0
Com_create_table 0
Com_create_trigger …Run Code Online (Sandbox Code Playgroud) 我有Facebook OpenGraph API的问题.每当我使用'/ home'或'/ feed'请求数据时,Instagram上没有任何帖子出现.
我一直在谷歌搜索,显然有些人提出了同样的问题,但还没有解决方案.我读到一些问题,不仅影响来自Instagram的帖子,还影响其他第三方应用/设备/平台.
甚至在Facebook的开发页面上张贴的门票似乎有点死(没有延续).链接:https://developers.facebook.com/bugs/110563582419837/
如果你们中的任何人也偶然发现了这个问题并且有一些想法/指针/链接,请分享并让我们讨论它.
非常感激.干杯!
我使用数百万条用于搜索结果的记录对表进行索引.我通过ASC或DESC订单显示结果.我的问题是列应该有索引吗?我在那张桌子上还有2个索引.性能如何通过制作或不制作该列的索引来影响?
我在MongoDB中插入了一个init文件:
db.User.insert({ "_id" : ObjectId("5589929b887dc1fdb501cdba"), "_class" : "com.smartinnotec.aposoft.dao.domain.User", "title" : "DI.", ... "address" : { "_id" : null, ... "country" : "Österreich" }})
Run Code Online (Sandbox Code Playgroud)
如果我用db.User.find()调用此条目,那么我得到以下内容:
{ "_id" : ObjectId("5589929b887dc1fdb501cdba"), "_class" : "com.smartinnotec.aposoft.dao.domain.User", "title" : "DI.", ... "address" : { "_id" : null, ... "country" : "�sterreich" } }
Run Code Online (Sandbox Code Playgroud)
带有特殊字符的单词"�sterreich不正确.
有没有人知道我在mongodb可以做些什么才能解决这个问题?
string-formatting utf special-characters mongodb spring-data
我正在使用mapbender3,它是在我的本地机器上的symfony2中开发的.我被要求将应用程序连接到远程potgreSQL服务器.以下是parameters.yml文件中的配置.
parameters:
database_driver: pdo_pgsql
database_host: 192.168.3.100
database_port: 5434
database_name: idc_core
database_path: ~
database_user: *******
database_password: *******
mailer_transport: smtp
mailer_host: localhost
mailer_user: ~
mailer_password: ~
Run Code Online (Sandbox Code Playgroud)
但是当我运行命令时:
php app/console doctrine:database:create
Run Code Online (Sandbox Code Playgroud)
我一直得到以下错误
could not create database for connection named "idc_core"
cound not find driver
Run Code Online (Sandbox Code Playgroud)
我在Windows 7上使用WAMP服务器,驱动程序pdo_pgsql在我的本地计算机上显示活动并运行.
我检查了phpinfo(),它显示pdo_pgsql已启用,但当我php -m在命令行中运行以查看编译的模块时,
我可以看到PDO,pdo_mysql和pdo_sqlite但不能看到pdo_pgsql
我有一个运行PostgreSQL v9.0的(生产)数据库服务器和一个运行PostgreSQL v8.4的开发机器.我想转储生产数据库并在开发机器上使用它.我无法升级dev机器上的postgres.
在生产机器上,我运行:
pg_dump -f nvdls.db -F p -U nvdladmin nvdlstats
Run Code Online (Sandbox Code Playgroud)
在开发机器上,我运行:
pg_restore -d nvdlstats -U nvdladmin nvdls.db
Run Code Online (Sandbox Code Playgroud)
我收到了这个错误:
pg_restore: [archiver] unsupported version (1.12) in file header
Run Code Online (Sandbox Code Playgroud)
无论我在转储时选择自定义,tar还是plain_text格式,都会发生这种情况.
我在网上发现了一个讨论,建议我pg_restore在开发机器上使用更新版本.我通过简单地将9.0二进制文件复制到开发机器来尝试这一点,但由于链接问题,这会失败(不会出乎意料).
我认为使用plain_text转储的意义在于它将是原始的可移植SQL.显然不是.
如何将9.0 DB安装到我的8.4安装中?
我希望通过API调用获得朋友的朋友,当我尝试这样做时,我得到以下异常,
{
"error": {
"type": "OAuthException",
"message": "(#604) Can't lookup all friends of .... Can only lookup for the logged in user (...), or friends of the logged in user with the appropriate permission"
}
}
Run Code Online (Sandbox Code Playgroud)
我尝试访问的网址是,
https://graph.facebook.com/friend_id/friends?access_token=access_token
我获得扩展权限,如下所示,
<fb:login-button perms="user_likes,friends_likes"></fb:login-button>
Run Code Online (Sandbox Code Playgroud)
请问任何人请告诉我这里出了什么问题?或者这是否意味着我永远无法访问朋友的朋友?
有没有人知道如何使用Facebook PHP SDK获取朋友的电子邮件地址列表?
从今天早上开始,我一直在努力使用图形API.
我正在尝试将消息发布到我的Facebook页面,但不是作为页面,就像我自己(用户).
当我尝试发布到朋友的页面时,一切正常并且消息已发布,但是当我尝试发布到我的页面(我是管理员)时,它要求获得manage_pages权限,如果我给予此权限,它将仅发布消息作为页面,而不是我自己!
有没有办法指定:是的我想发布到我的页面的墙上,是的我是管理员,但我想以用户身份发布?
public function postToWall($pageId, $msg) {
if($pageId) {
$this->callAPI('/'.$pageId.'/feed', 'POST', array(
'message' => $msg
));
}
}
/**
* @param $path
* @param string $method default to GET
* @param array $params additional params
* @return mixed
*/
public function callAPI($path, $method = 'GET', $params = array()) {
$params = array_merge(array('access_token' => $this->getAccessToken()), $params);
return $this->api($path, $method, $params);
}
Run Code Online (Sandbox Code Playgroud)
它返回:
Uncaught OAuthException: (#283) Requires extended permission: manage_pages
Run Code Online (Sandbox Code Playgroud)
我已经检查过,access_token是我的用户访问令牌.
我有"publish_stream"权限.
任何帮助,将不胜感激 !谢谢
我希望通过拥有$或者财产来获得$ cond的$ sum:
db.collectionName.aggregate(
{
"$group": {
"_id":'$created_at',
"count": {"$sum": 1},
"count_failure": {
"$sum": {
"$cond": [
{
"$id":
{ "$in": [ 0,100,101,102,103,104,105 ] }
},
1,
0
]
}
}
}
}
)
Run Code Online (Sandbox Code Playgroud)
但错误说: Invalid operator "$id"
语法有什么问题?或者我错误地写了查询.
目前我通过以下方式实现此目标
db.collectionName.aggregate(
{
"$group": {
"_id":'$created_at',
"count": {"$sum": 1},
"count_failure": {
"$sum": {
"$cond": [
{
"$or":[
{ "$eq": [ "$id", 0 ] },
{ "$eq": [ "$id", 100 ]},
{ "$eq": [ "$id", 101 ]},
{ "$eq": [ "$id", 102 …Run Code Online (Sandbox Code Playgroud) facebook ×4
mongodb ×2
mysql ×2
performance ×2
postgresql ×2
api ×1
database ×1
email ×1
export ×1
facebook-fql ×1
indexing ×1
instagram ×1
mapbender3 ×1
opengraph ×1
optimization ×1
pdo ×1
pg-dump ×1
php ×1
psql ×1
publish ×1
restore ×1
spring-data ×1
sql ×1
sql-order-by ×1
symfony ×1
utf ×1
variables ×1