Windows下编译MySQL5.6.7和MariaDB5.5.27_摔伤硬盘 数据恢

日期:2014-07-13 / 人气: / 来源:网络

听说 mysql5.6.7的优化器改了不少,想陆续学习一下。为了能用vc跟踪,就在winodws下用vc来编译了。
( 注意,mariadb5.5.27也用同样方法编译通过,可以学习牛人在server端的大量改进了!)
用Visual C 2008 express版本,编译。免费的,而且正版,多棒。
进入Visual Studio 2008命令提示(不是直接运行cmd)
D:mysql-5.6.7-rc>cmake . -G “Visual Studio 9 2008″
�C Check for working C compiler using: Visual Studio 9 2008
�C Check for working C compiler using: Visual Studio 9 2008 ― works
�C Detecting C compiler ABI info
�C Detecting C compiler ABI info �C done
�C Check for working CXX compiler using: Visual Studio 9 2008
�C Check for working CXX compiler using: Visual Studio 9 2008 ― works
�C Detecting CXX compiler ABI info
�C Detecting CXX compiler ABI info �C done
�C Check size of void *
�C Check size of void * �C done
�C MySQL 5.6.7-rc
�C Packaging as: mysql-5.6.7-rc-win32
�C Looking for include files HAVE_SASL_SASL_H
�C Looking for include files HAVE_SASL_SASL_H �C not found.
�C Looking for include files HAVE_DEVPOLL
�C Looking for include files HAVE_DEVPOLL �C not found.
�C Looking for include files HAVE_SIGNAL_H
�C Looking for include files HAVE_SIGNAL_H �C found
�C Looking for include files HAVE_SYS_DEVPOLL_H
�C Looking for include files HAVE_SYS_DEVPOLL_H �C not found.
�C Looking for include files HAVE_SYS_EPOLL_H
�C Looking for include files HAVE_SYS_EPOLL_H �C not found.
�C Looking for include files HAVE_SYS_EVENT_H
�C Looking for include files HAVE_SYS_EVENT_H �C not found.
�C Looking for include files HAVE_SYS_QUEUE_H
�C Looking for include files HAVE_SYS_QUEUE_H �C not found.
�C Looking for TAILQ_FOREACH
�C Looking for TAILQ_FOREACH �C not found.
�C Looking for include files CMAKE_HAVE_PTHREAD_H
�C Looking for include files CMAKE_HAVE_PTHREAD_H �C not found.
�C Found Threads: TRUE
�C Looking for _aligned_malloc
�C Looking for _aligned_malloc �C found
�C Looking for _aligned_free
�C Looking for _aligned_free �C found
�C Looking for fedisableexcept
�C Looking for fedisableexcept �C not found
�C Looking for posix_memalign
�C Looking for posix_memalign �C not found
�C Looking for ntohll
�C Looking for ntohll �C not found
�C Looking for clock_gettime
�C Looking for clock_gettime �C not found
�C Looking for epoll_create
�C Looking for epoll_create �C not found
�C Looking for epoll_ctl
�C Looking for epoll_ctl �C not found
�C Looking for inet_ntop
�C Looking for inet_ntop �C not found
�C Looking for kqueue
�C Looking for kqueue �C not found
�C Looking for kqueue
�C Looking for kqueue �C not found
�C Looking for signal
�C Looking for signal �C found
�C Looking for timeradd
�C Looking for timeradd �C not found.
�C Looking for timerclear
�C Looking for timerclear �C not found.
�C Looking for timercmp
�C Looking for timercmp �C not found.
�C Looking for timerisset
�C Looking for timerisset �C not found.
�C Check size of time_t
�C Check size of time_t �C done
�C Performing Test TIME_T_UNSIGNED
�C Performing Test TIME_T_UNSIGNED �C Failed
�C Looking for sched_getcpu
�C Looking for sched_getcpu �C not found
�C Looking for asprintf
�C Looking for asprintf �C not found
�C Using cmake version 2.8.2
�C Not building NDB
�C
Googletest was not found. gtest-based unit tests will be disabled. You
can run cmake . -DENABLE_DOWNLOADS=1 to automatically download and build
req
uired components from source.
�C If you are inside a firewall, you may need to use an http proxy: export http_proxy=http://foo.bar.com:80
Warning: Bison executable not found in PATH
�C Cannot find wix 3, installer project will not be generated
�C Configuring done
�C Generating done
�C Build files have been written to: D:/mysql-5.6.7-rc
D:mysql-5.6.7-rc>cmake . -L
�C MySQL 5.6.7-rc
�C Packaging as: mysql-5.6.7-rc-win32
�C Using cmake version 2.8.2
�C Not building NDB
Warning: Bison executable not found in PATH
�C Configuring done
�C Generating done
�C Build files have been written to: D:/mysql-5.6.7-rc
�C Cache values
CMAKE_BUILD_TYPE:STRING=RelWithDebInfo
CMAKE_INSTALL_PREFIX:PATH=C:/Program Files/MySQL
COMMUNITY_BUILD:BOOL=ON
ENABLED_PROFILING:BOOL=ON
ENABLE_DEBUG_SYNC:BOOL=ON
ENABLE_DOWNLOADS:BOOL=OFF
ENABLE_GCOV:BOOL=OFF
ENABLE_GPROF:BOOL=OFF
FEATURE_SET:STRING=community
INSTALL_LAYOUT:STRING=STANDALONE
MYSQL_DATADIR:PATH=C:/Program Files/MySQL/MySQL Server 5.6/data
MYSQL_MAINTAINER_MODE:BOOL=OFF
OPTIMIZER_TRACE:BOOL=ON
WITH_ARCHIVE_STORAGE_ENGINE:BOOL=ON
WITH_BLACKHOLE_STORAGE_ENGINE:BOOL=ON
WITH_DEBUG:BOOL=OFF
WITH_DEFAULT_COMPILER_OPTIONS:BOOL=ON
WITH_DEFAULT_FEATURE_SET:BOOL=ON
WITH_EMBEDDED_SERVER:BOOL=ON
WITH_EXAMPLE_STORAGE_ENGINE:BOOL=OFF
WITH_EXTRA_CHARSETS:STRING=all
WITH_FEDERATED_STORAGE_ENGINE:BOOL=ON
WITH_INNOBASE_STORAGE_ENGINE:BOOL=ON
WITH_INNODB_MEMCACHED:BOOL=OFF
WITH_LIBEVENT:STRING=bundled
WITH_PARTITION_STORAGE_ENGINE:BOOL=ON
WITH_PERFSCHEMA_STORAGE_ENGINE:BOOL=ON
WITH_SSL:STRING=bundled
WITH_UNIT_TESTS:BOOL=ON
WITH_ZLIB:STRING=bundled
WIX_DIR:PATH=WIX_DIR-NOTFOUND
Visual C 2008用F7编译
3>―― 已启动生成: 项目: sql_embedded, 配置: Debug Win32 ――
2>正在编译…
3>正在编译…
2>sql_locale.cc
3>sql_locale.cc
2>.sql_locale.cc(621) : warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
3>..sqlsql_locale.cc(621) : warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
2>.sql_locale.cc(789) : error C2146: 语法错误 : 缺少“}”(在标识符“嗒�噜��噜�苦”的前面)
3>..sqlsql_locale.cc(789) : error C2146: 语法错误 : 缺少“}”(在标识符“嗒�噜��噜�苦”的前面)
2>.sql_locale.cc(789) : error C2146: 语法错误 : 缺少“;”(在标识符“嗒�噜��噜�苦”的前面)
2>.sql_locale.cc(789) : error C2143: 语法错误 : 缺少“;”(在“字符串”的前面)
3>..sqlsql_locale.cc(789) : error C2146: 语法错误 : 缺少“;”(在标识符“嗒�噜��噜�苦”的前面)
2>.sql_locale.cc(789) : error C4430: 缺少类型说明符 �C 假定为 int。注意: C 不支持默认 int
3>..sqlsql_locale.cc(789) : error C2143: 语法错误 : 缺少“;”(在“字符串”的前面)
2>.sql_locale.cc(789) : error C2143: 语法错误 : 缺少“;”(在“}”的前面)
3>..sqlsql_locale.cc(789) : error C4430: 缺少类型说明符 �C 假定为 int。注意: C 不支持默认 int
2>.sql_locale.cc(789) : error C2059: 语法错误 : “}”
3>..sqlsql_locale.cc(789) : error C2143: 语法错误 : 缺少“;”(在“}”的前面)
2>.sql_locale.cc(791) : error C2146: 语法错误 : 缺少“}”(在标识符“嗒��嗒”的前面)
3>..sqlsql_locale.cc(789) : error C2059: 语法错误 : “}”
2>.sql_locale.cc(791) : error C2146: 语法错误 : 缺少“;”(在标识符“嗒��嗒”的前面)
3>..sqlsql_locale.cc(791) : error C2146: 语法错误 : 缺少“}”(在标识符“嗒��嗒”的前面)
2>.sql_locale.cc(791) : error C4430: 缺少类型说明符 �C 假定为 int。注意: C 不支持默认 int
3>..sqlsql_locale.cc(791) : error C2146: 语法错误 : 缺少“;”(在标识符“嗒��嗒”的前面)
2>.sql_locale.cc(791) : error C2059: 语法错误 : “字符串”
3>..sqlsql_locale.cc(791) : error C4430: 缺少类型说明符 �C 假定为 int。注意: C 不支持默认 int
2>.sql_locale.cc(791) : error C2143: 语法错误 : 缺少“;”(在“}”的前面)
3>..sqlsql_locale.cc(791) : error C2059: 语法错误 : “字符串”
2>.sql_locale.cc(791) : error C2059: 语法错误 : “}”
3>..sqlsql_locale.cc(791) : error C2143: 语法错误 : 缺少“;”(在“}”的前面)
2>.sql_locale.cc(793) : error C2146: 语法错误 : 缺少“}”(在标识符“嗒多��嗒�喃�嗒班嗒距”的前面)
3>..sqlsql_locale.cc(791) : error C2059: 语法错误 : “}”
2>.sql_locale.cc(793) : error C2146: 语法错误 : 缺少“;”(在标识符“嗒多��嗒�喃�嗒班嗒距”的前面)
3>..sqlsql_locale.cc(793) : error C2146: 语法错误 : 缺少“}”(在标识符“嗒多��嗒�喃�嗒班嗒距”的前面)
2>.sql_locale.cc(793) : error C2143: 语法错误 : 缺少“;”(在“字符串”的前面)
3>..sqlsql_locale.cc(793) : error C2146: 语法错误 : 缺少“;”(在标识符“嗒多��嗒�喃�嗒班嗒距”的前面)
字符集问题
用notepad 打开sql_locale.cc
在菜单“格式”中选择“以UTF-8格式编码”,保存
VC用F7编译
21>CMake Error at D:/mysql-5.6.7-rc/sql/create_initial_db.cmake:100 (MESSAGE):
21>  Could not create initial database
21>   
21>  
121008 11:56:14 [Warning] TIMESTAMP with implicit DEFAULT value is
deprecated. Please use �Cexplicit_defaults_for_timestamp server option
(see documentation for more details).
21>  Assertion failed: 0, file .mysqld.cc, line 5011
21> 
21>  This application has requested the Runtime to terminate it in an unusual
21>  way.
21>  Please contact the application’s support team for more information.
21> 
21>  This application has requested the Runtime to terminate it in an unusual
21>  way.
21>  Please contact the application’s support team for more information.
21>  03:56:14 UTC �C mysqld got exception 0×80000003 ;
21>  This could be because you hit a bug.  It is also possible that this binary
21>  or one of the libraries it was linked against is corrupt, improperly built,
21>  or misconfigured.  This error can also be caused by malfunctioning
21>  hardware.
21>  We will try our best to scrape up some info that will hopefully help
21>  diagnose the problem, but since we have already crashed,
21>  something is definitely wrong and this may fail.
21> 
21>  key_buffer_size=0
21>  read_buffer_size=131072
21>  max_used_connections=0
21>  max_threads=151
21>  thread_count=0
21>  connection_count=0
21>  It is possible that mysqld could use up to
21>  key_buffer_size (read_buffer_size sort_buffer_size)*max_threads = 59364
21>  K bytes of memory
21>  Hope that’s ok; if not, decrease some variables in the equation.
21> 
21>  Thread pointer: 0×0
21>  Attempting backtrace.  You can use the following information to find out
21>  where mysqld died.  If you see no messages after this, something went
21>  terribly wrong…
21>  ec90b3 mysqld.exe!my_sigabrt_handler()[my_thr_init.c:499]
21>  1386aab mysqld.exe!raise()[winsig.c:590]
21>  1391485 mysqld.exe!abort()[abort.c:71]
21>  1385bf7 mysqld.exe!_wassert()[assert.c:346]
21>  a9a9f5 mysqld.exe!test_lc_time_sz()[mysqld.cc:5011]
21>  a96f94 mysqld.exe!win_main()[mysqld.cc:5227]
21>  a9aaab mysqld.exe!mysql_service()[mysqld.cc:5554]
21>  a9ae46 mysqld.exe!mysqld_main()[mysqld.cc:5748]
21>  a91010 mysqld.exe!main()[main.cc:25]
21>  1384f57 mysqld.exe!__tmainCRTStartup()[crt0.c:266]
21>  1384e2f mysqld.exe!mainCRTStartup()[crt0.c:182]
21>  7618ed6c kernel32.dll!BaseThreadInitThunk()
21>  77d5377b ntdll.dll!RtlInitializeExceptionChain()
21>  77d5374e ntdll.dll!RtlInitializeExceptionChain()
21>  The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
21>  information that should help you find out what is causing the crash.
21>Project : error PRJ0019: 某个工具从以下位置返回了错误 “Generating initdb.dep”
21>生成日志保存在“file://d:mysql-5.6.7-rcsqlinitial_database.dirDebugBuildLog.htm”
21>initial_database �C 1 个错误,0 个警告
19>生成日志保存在“file://d:mysql-5.6.7-rcpluginauthqa_auth_interface.dirDebugBuildLog.htm”
19>qa_auth_interface �C 0 个错误,0 个警告
20>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
20>Copyright (C) Microsoft Corporation.  All rights reserved.
20>生成日志保存在“file://d:mysql-5.6.7-rcpluginauthqa_auth_server.dirDebugBuildLog.htm”
20>qa_auth_server �C 0 个错误,0 个警告
30>―― 已跳过生成: 项目: PACKAGE, 配置: Debug Win32 ――
30>没有为此解决方案配置选中要生成的项目
31>―― 已跳过生成: 项目: INSTALL, 配置: Debug Win32 ――
31>没有为此解决方案配置选中要生成的项目
========== 生成: 成功 22 个,失败 1 个,最新 98 个,跳过 8 个 ==========
这个错误在编译以前的版本时也遇到了,猜测test_lc_time_sz不是个很重要的步骤,就改成直接返回了。修改mysqld.cc,我增加了两行
#ifndef EMBEDDED_LIBRARY
#ifndef DBUG_OFF
/*
  Debugging helper function to keep the locale database
  (see sql_locale.cc) and max_month_name_length and
  max_day_name_length variable values in consistent state.
*/
static void test_lc_time_sz()
{
  DBUG_ENTER(“test_lc_time_sz”);
  /*gulei added*/
  DBUG_VOID_RETURN;
  for (MY_LOCALE **loc= my_locales; *loc; loc )
  {
    uint max_month_len= 0;
    uint max_day_len = 0;
再编译就过了
用vc跟踪代码还是很直观的,大家可以试试。

MySQL数据库管理常用命令

在Linux下管理MySQL数据库的时候总有一些很紧急的情况,发现数据库突然变得压力很大了,那么作为一个DBA,也许需要一些常用的手段或者说命令去分析问题出现在哪里,然后解决:数据库突然产生压力时查看正在查询的SQL:(如果这里内容太多表示并发执行的SQL过多

MySQL教程

作者:管理员




现在致电4006-2991-90 OR 查看更多联系方式 →

Go To Top 回顶部