在运行Php 5.4的Linux MySQL 5.6服务器中,以下命令需要2-3秒
exec("mysql --host=$db_host --user=$db_user --password=$db_password $db_name < $sql_file");
Run Code Online (Sandbox Code Playgroud)
在具有类似配置的窗口上,需要10-15秒.Windows机器有更多的RAM(16GB)和类似的硬盘驱动器.我安装了MySQL 5.6并没有进行配置更改.这是在Windows Server 2012上.
我可以更改哪些配置来解决此问题?
数据库文件创建了大约40个innodb表,其中包含非常少的插入.
编辑:这是我正在运行的文件:
https://www.dropbox.com/s/uguzgbbnyghok0o/database_14.4.sql?dl=0
更新:在Windows 8和7上它是3秒.但在Windows Server 2012上它是15秒以上.我禁用了System Center 2012,但没有任何区别.
更新2:
我也试过杀死除mysql和IIS之外的几乎所有服务,它仍然执行缓慢.Windows Server 2012中是否存在导致此速度变慢的问题?
更新3我尝试禁用写缓存缓冲区刷新,性能现在很好.
我没有必要在我测试的其他机器上执行此操作.这是否表明磁盘是如何设置的?
我试图找出节点如何映射回它们包含的字段用于学习目的.这是怎么做到的?
目标:按地区显示每个种族和年份的种族数据占总数的百分比.
问题:查询需要30分钟才能运行.我想把它降到10秒以下.还有另一种解决这个问题的策略是我没想到的吗?
查询:
SELECT field_data_field_district_id.field_district_id_value as district_id, year, race, ROUND(SUM(count)/(
SELECT SUM(count)
FROM school_data_race_ethnicity_raw as school_data_race_ethnicity_raw_inner
INNER JOIN field_data_field_school_id as field_data_field_school_id_inner ON field_data_field_school_id_inner.field_school_id_value = school_data_race_ethnicity_raw_inner.school_id
INNER JOIN field_data_field_district as field_data_field_district_inner ON field_data_field_district_inner.entity_id = field_data_field_school_id_inner.entity_id
INNER JOIN field_data_field_district_id as field_data_field_district_id_inner ON field_data_field_district_inner.field_district_nid = field_data_field_district_id_inner.entity_id
WHERE field_data_field_district_id_inner.field_district_id_value = field_data_field_district_id.field_district_id_value and
school_data_race_ethnicity_raw_inner.year = school_data_race_ethnicity_raw.year
) * 100 ,2) as percent
FROM school_data_race_ethnicity_raw
INNER JOIN field_data_field_school_id ON field_data_field_school_id.field_school_id_value = school_data_race_ethnicity_raw.school_id
INNER JOIN field_data_field_district ON field_data_field_district.entity_id = field_data_field_school_id.entity_id
INNER JOIN field_data_field_district_id ON field_data_field_district.field_district_nid = …Run Code Online (Sandbox Code Playgroud) 我在文档中找不到这个,但是:
max_input_time = -1
Run Code Online (Sandbox Code Playgroud)
意味着没有限制?
我觉得很奇怪,这max_execution_time = 0是永远的.
但这-1意味着max_input_time什么?
当我做sudo gem install XYZ那个代码实际上去了哪里?用另一种语言用宝石写的宝石?
当我进行捆绑安装时,它会做什么?我通读了rails教程,但它似乎忽略了那些重要的细节.
如果我有一个1000x3000像素的图像,并且我使用负背景位置,这是如何工作的?
我认为通过向左移动209像素然后向上移动2个像素,然后显示实际剩下的部分,但它似乎与此相反.
我很难理解hook_theme()的作用.
我的理解是它与可以覆盖模板有关.
我在看:
$theme_hooks = array(
'poll_vote' => array(
'template' => 'poll-vote',
'render element' => 'form',
),
'poll_choices' => array(
'render element' => 'form',
),
'poll_results' => array(
'template' => 'poll-results',
'variables' => array('raw_title' => NULL, 'results' => NULL, 'votes' => NULL, 'raw_links' => NULL, 'block' => NULL, 'nid' => NULL, 'vote' => NULL),
),
'poll_bar' => array(
'template' => 'poll-bar',
'variables' => array('title' => NULL, 'votes' => NULL, 'total_votes' => NULL, 'vote' => NULL, 'block' => NULL), …Run Code Online (Sandbox Code Playgroud) function example_module_node_view($node, $view_mode, $langcode)
{
$f = drupal_get_form('example_module_form', $node);
$node->content['data_collection_form'] = array('#value' => $f, '#weight' => 1);
}
Run Code Online (Sandbox Code Playgroud)
为什么表格不显示?难道我做错了什么?正在填充表单对象.我可以做#markup =>'Something'并且它有效.
我正在尝试使用brew包管理器安装nginx,但无法链接.我怎样才能解决这个问题?
roc-web5537:Downloads cmuench$ brew install nginx
Warning: Your Xcode (4.3.3) is outdated
Please install Xcode 4.5.
==> Installing nginx dependency: pcre
==> Downloading ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.31.tar.bz2
Already downloaded: /Library/Caches/Homebrew/pcre-8.31.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/pcre/8.31 --enable-utf8 --enable-unicode-properties --enable-pcregrep-libz --enable-pcregrep-libbz2
==> make test
==> make install
Warning: Could not link pcre. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link pcre'
==> Summary
/usr/local/Cellar/pcre/8.31: 130 files, 3.2M, built in …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用ssl证书验证调试问题,并确定openssl获取返回错误路径的证书位置.(见下文)
我如何弄清楚如何设置它?我查看了php.ini文件,无法在任何地方找到此引用.
cmuench-air:bin cmuench$ ./php -r "print_r(openssl_get_cert_locations());"
Array
(
[default_cert_file] => /bitnami/mampstack56Dev-osx-x64/output/common/openssl/cert.pem
[default_cert_file_env] => SSL_CERT_FILE
[default_cert_dir] => /bitnami/mampstack56Dev-osx-x64/output/common/openssl/certs
[default_cert_dir_env] => SSL_CERT_DIR
[default_private_dir] => /bitnami/mampstack56Dev-osx-x64/output/common/openssl/private
[default_default_cert_area] => /bitnami/mampstack56Dev-osx-x64/output/common/openssl
[ini_cafile] =>
[ini_capath] =>
)
Run Code Online (Sandbox Code Playgroud)
php.ini(相关部分)...我在任何地方都看不到bitnami/mampstack56Dev ......
[openssl]
; The location of a Certificate Authority (CA) file on the local filesystem
; to use when verifying the identity of SSL/TLS peers. Most users should
; not specify a value for this directive as PHP will attempt to use the
; OS-managed cert stores …Run Code Online (Sandbox Code Playgroud)