在windows编译MariaDB
2016-05-18 16:57
501 查看
OS: Windows XP sp3
IDE: VS2010(including the (free) express editions)
MariaDB: V5.5
(清华大学 TUNA 镜像源可用)
(.tar.gz为源码;.zip为执行程序)
Source: https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-5.5.55/source/mariadb-5.5.55.tar.gz
Zip: https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-5.5.55/win32-packages/mariadb-5.5.55-win32.zip
首先安装如下工具和Boost库:
(1) Bazzar
https://launchpad.net/bzr/2.5/2.5.1/+download/bzr-2.5.1-1-setup.exe
(2) Bison from GnuWin32
http://jaist.dl.sourceforge.net/project/gnuwin32/bison/2.4.1/bison-2.4.1-setup.exe
(3) Cmake
https://cmake.org/files/v3.4/cmake-3.4.3-win32-x86.exe
V3.4.3是可以在XP中运行的。
Boost库:
(1) 下载
http://www.boost.org/users/download/
当前最新版本为V1.63.0
(2) 设置系统变量
a. BOOST_HOME
C:\boost_1_63_0
b. 增加变量到path
然后执行编译:
检查系统变量path,以保证包含如下设置:
(1)cmake ..
(2) sql/sql_locale.cc
使用Notepad++打开此文件并另存为同名。“以 UTF-8 无 BOM 格式编码” -> “以 UTF-8 格式编码”!
(3) 生成
最后,拷贝文件。
拷贝以下两个文件覆盖到D:\progFiles\MariaDB55\bin,以替换不能在XP运行的程序。
bld\sql\RelWithDebInfo\mysqld.exe
bld\sql\RelWithDebInfo\mysqld.pdb
FAQ:
1. error C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE'
在进行storage\oqgraph目录编译时发生错误。
解决办法:
注释掉named_graph.hpp(C:\boost_1_63_0\boost\graph)的314行代码。
参考文档:
1. Building MariaDB on Windows
https://mariadb.com/kb/en/mariadb/Building_MariaDB_on_Windows/
2. 关于mysqld不是有效的win32程序
http://www.cnblogs.com/xiaobin-hlj80/p/5500152.html
3. 安装boost库(Windows)
http://www.cnblogs.com/xiaobin-hlj80/p/5503842.html
IDE: VS2010(including the (free) express editions)
MariaDB: V5.5
(清华大学 TUNA 镜像源可用)
(.tar.gz为源码;.zip为执行程序)
Source: https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-5.5.55/source/mariadb-5.5.55.tar.gz
Zip: https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-5.5.55/win32-packages/mariadb-5.5.55-win32.zip
首先安装如下工具和Boost库:
(1) Bazzar
https://launchpad.net/bzr/2.5/2.5.1/+download/bzr-2.5.1-1-setup.exe
(2) Bison from GnuWin32
http://jaist.dl.sourceforge.net/project/gnuwin32/bison/2.4.1/bison-2.4.1-setup.exe
(3) Cmake
https://cmake.org/files/v3.4/cmake-3.4.3-win32-x86.exe
V3.4.3是可以在XP中运行的。
Boost库:
(1) 下载
http://www.boost.org/users/download/
当前最新版本为V1.63.0
(2) 设置系统变量
a. BOOST_HOME
C:\boost_1_63_0
b. 增加变量到path
然后执行编译:
检查系统变量path,以保证包含如下设置:
C:\Program Files\Bazaar;C:\GnuWin32\bin;C:\boost_1_63_0;C:\Program Files\CMake\bin
(1)cmake ..
Microsoft Windows XP [版本 5.1.2600] (C) 版权所有 1985-2001 Microsoft Corp. C:\Documents and Settings\zc01>d: D:\>cd mariadb-5.5.55 D:\mariadb-5.5.55>mkdir bld D:\mariadb-5.5.55>cd bld D:\mariadb-5.5.55\bld>cmake .. -- Building for: Visual Studio 10 2010 -- Running cmake version 3.4.3 -- The C compiler identification is MSVC 16.0.30319.1 -- The CXX compiler identification is MSVC 16.0.30319.1 -- Check for working C compiler using: Visual Studio 10 2010 -- Check for working C compiler using: Visual Studio 10 2010 -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler using: Visual Studio 10 2010 -- Check for working CXX compiler using: Visual Studio 10 2010 -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for isnan -- Looking for isnan - not found -- Looking for snprintf -- Looking for snprintf - not found -- Looking for _snprintf -- Looking for _snprintf - found -- MariaDB 5.5.55 -- Check size of void * -- Check size of void * - done -- Packaging as: mariadb-5.5.55-win32 -- Looking for pthread.h -- Looking for pthread.h - not found -- Found Threads: TRUE -- Looking for isnan -- Looking for isnan - not found -- Check size of time_t -- Check size of time_t - done -- Performing Test STRUCT_TIMESPEC_HAS_TV_SEC -- Performing Test STRUCT_TIMESPEC_HAS_TV_SEC - Failed -- Performing Test STRUCT_TIMESPEC_HAS_TV_NSEC -- Performing Test STRUCT_TIMESPEC_HAS_TV_NSEC - Failed -- Looking for malloc_stats_print in jemalloc -- Looking for malloc_stats_print in jemalloc - not found -- Performing Test HAVE_WVLA -- Performing Test HAVE_WVLA - Failed -- Performing Test HAVE_WERROR -- Performing Test HAVE_WERROR - Failed -- Boost version: 1.63.0 -- Performing Test HAVE_XUCRED -- Performing Test HAVE_XUCRED - Failed Warning: Bison executable not found in PATH -- Looking for MFC -- Looking for MFC - not found -- Cannot find wix 3, installer project will not be generated -- Configuring done -- Generating done -- Build files have been written to: D:/mariadb-5.5.55/bld D:\mariadb-5.5.55\bld>
(2) sql/sql_locale.cc
使用Notepad++打开此文件并另存为同名。“以 UTF-8 无 BOM 格式编码” -> “以 UTF-8 格式编码”!
(3) 生成
cmake --build . --config Relwithdebinfo
最后,拷贝文件。
拷贝以下两个文件覆盖到D:\progFiles\MariaDB55\bin,以替换不能在XP运行的程序。
bld\sql\RelWithDebInfo\mysqld.exe
bld\sql\RelWithDebInfo\mysqld.pdb
FAQ:
1. error C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE'
在进行storage\oqgraph目录编译时发生错误。
"D:\mariadb-5.5.55\bld\ALL_BUILD.vcxproj" (default target) (1) -> "D:\mariadb-5.5.55\bld\storage\oqgraph\oqgraph.vcxproj" (default target) (131) -> (ClCompile target) -> D:\boost_1_63_0\boost/graph/named_graph.hpp(314): error C2338: Named graphs c annot use vecS as vertex container and remove vertices; the lack of vertex desc riptor stability (which iterator stability is a proxy for) means that the name -> vertex mapping would need to be completely rebuilt after each deletion. See https://svn.boost.org/trac/boost/ticket/7863 for more information and a test c ase. [D:\mariadb-5.5.55\bld\storage\oqgraph\oqgraph.vcxproj] 3055 Warning(s) 1 Error(s) Time Elapsed 00:03:41.48 D:\mariadb-5.5.55\bld>
解决办法:
注释掉named_graph.hpp(C:\boost_1_63_0\boost\graph)的314行代码。
参考文档:
1. Building MariaDB on Windows
https://mariadb.com/kb/en/mariadb/Building_MariaDB_on_Windows/
2. 关于mysqld不是有效的win32程序
http://www.cnblogs.com/xiaobin-hlj80/p/5500152.html
3. 安装boost库(Windows)
http://www.cnblogs.com/xiaobin-hlj80/p/5503842.html
相关文章推荐
- 关于MariaDB5.5不是有效的Win32 应用程序
- 数据同步:搜索引擎实时化
- 怎样将 MySQL 迁移到 MariaDB 上
- Centos下使用yum安装MariaDB
- 解决mariadb识别字母大小敏感问题
- CentOS7.0启动MariaDB
- centos 7 MariaDB 开始
- mariadb主从复制
- mariadb卸载
- fedora23下安装mariadb(原mysql)
- 处理mariaDB 10.1.12安装报错一例
- oracle通过DBlink连接mysql(MariaDB)
- 源码编译安装mariadb-5.5.48
- 安装mariadb数据库=centos7自学之四
- MariaDB存储引擎
- MariaDB存储引擎
- 关于mysql(或MariaDB)中的用户账号格式
- mysql(mariadb)定时自动热备份+增量+远程备份脚本
- 提取mariadb(mysql) 报错日志并自动邮件上报告警内容
- mariadb galera cluster数据库集群一键安装脚本