`
zxl7049
  • 浏览: 30244 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

linux 下 源码编译 mysql.5.19

阅读更多
今天安装在linux 下安装sphinx 需要支持mysql 的检索功能
安装mysql的rpm 包的时候 sphinx  老是报 mysql-devel 的错误
即使安装了 mysql-devel 的rpm 包也出现同样的问题
下面是用源码编译mysql.5.19的过程
mysql 映像文件地址 http://mysql.mirrors.ilisys.com.au/Downloads/
[root@localhost local]# wget http://mysql.mirrors.pair.com/Downloads/MySQL-5.5/mysql-5.5.19.tar.gz
[root@localhost local]# tar -zvxf mysql-5.5.19.tar.gz 
[root@localhost local]# cd mysql-5.5.19

安装cmake
(mysql5.5以后是通过cmake来编译的)
下载解压cmake-2.8.4.tar.gz
[root@localhost local] wget http://www.coreseek.cn/uploads/csft/3.2/coreseek-3.2.14.tar.gz
[root@localhost mysql-5.5.19]# tar zxvf cmake-2.8.4.tar.gz
[root@localhost mysql-5.5.19]# cd cmake-2.8.4
[root@localhost mysql-5.5.19]#./configure
[root@localhost mysql-5.5.19]# make && make install
[root@localhost mysql-5.5.19]# cmake  -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=utf8,gbk -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/data/mysql -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306 

出现了下面的问题 :
-- MySQL 5.5.19
-- Could NOT find Curses (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:83 (MESSAGE):
  Curses library not found.  Please install appropriate package,
      remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
  cmake/readline.cmake:118 (FIND_CURSES)
  cmake/readline.cmake:214 (MYSQL_USE_BUNDLED_READLINE)
  CMakeLists.txt:257 (MYSQL_CHECK_READLINE)
-- Configuring incomplete, errors occurred!
[root@localhost mysql-5.5.19]# yum install ncurses-devel
[root@localhost mysql-5.5.19]# rm -rf CMakeCache.txt
重新编译安装 
[ 79%] Building C object sql/CMakeFiles/sql.dir/__/sql-common/client.c.o
/mysql-5.5.19/sql-common/client.c:2325: 警告:提领类型双关的指针将破坏强重叠规则
/mysql-5.5.19/sql-common/client.c:2326: 警告:提领类型双关的指针将破坏强重叠规则
/mysql-5.5.19/sql-common/client.c:2327: 警告:提领类型双关的指针将破坏强重叠规则
/mysql-5.5.19/sql-common/client.c: In function ‘run_plugin_auth’:
/mysql-5.5.19/sql-common/client.c:2840: 警告:提领类型双关的指针将破坏强重叠规则
/mysql-5.5.19/sql-common/client.c:2910: 警告:提领类型双关的指针将破坏强重叠规则
[ 79%] Building CXX object sql/CMakeFiles/sql.dir/derror.cc.o
[ 79%] Building CXX object sql/CMakeFiles/sql.dir/des_key_file.cc.o
[ 79%] Building CXX object sql/CMakeFiles/sql.dir/discover.cc.o
[ 79%] Building C object sql/CMakeFiles/sql.dir/__/libmysql/errmsg.c.o
[ 79%] Building CXX object sql/CMakeFiles/sql.dir/field.cc.o
[ 80%] Building CXX object sql/CMakeFiles/sql.dir/field_conv.cc.o
[ 80%] Building CXX object sql/CMakeFiles/sql.dir/filesort.cc.o
[ 80%] Building CXX object sql/CMakeFiles/sql.dir/gstream.cc.o
[ 80%] Building CXX object sql/CMakeFiles/sql.dir/sha2.cc.o
[ 80%] Building CXX object sql/CMakeFiles/sql.dir/handler.cc.o
[ 80%] Building CXX object sql/CMakeFiles/sql.dir/hostname.cc.o
[ 80%] Building CXX object sql/CMakeFiles/sql.dir/init.cc.o
[ 81%] Building CXX object sql/CMakeFiles/sql.dir/item.cc.o
/mysql-5.5.19/sql/item.cc: In member function ‘virtual bool Item_field::fix_fields(THD*, Item**)’:
/mysql-5.5.19/sql/item.cc:4700: 警告:提领类型双关的指针将破坏强重叠规则
[ 81%] Building CXX object sql/CMakeFiles/sql.dir/item_buff.cc.o
[ 81%] Building CXX object sql/CMakeFiles/sql.dir/item_cmpfunc.cc.o
[ 81%] Building CXX object sql/CMakeFiles/sql.dir/item_create.cc.o
[ 81%] Building CXX object sql/CMakeFiles/sql.dir/item_func.cc.o
以上可忽略不计
[root@localhost mysql-5.5.19]# cp  support-files/my-medium.cnf /etc/my.cnf 
赋给文件执行权限
[root@localhost mysql-5.5.19]# chmod 755 scripts/mysql_install_db
初始安装数据库
[root@localhost mysql-5.5.19]# scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql/

Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

Alternatively you can run:
/usr/local/mysql/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/local/mysql/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/local/mysql/scripts/mysqlbug script!
设置mysqld的开机启动:

[root@localhost mysql-5.5.19]# cp  support-files/mysql.server /etc/init.d/mysql
[root@localhost mysql-5.5.19]# chmod 775 /etc/init.d/mysql
启动数据库
[root@localhost mysql-5.5.19]# /etc/init.d/mysql start
Starting MySQL.................                            [确定]

分享到:
评论

相关推荐

    linux下mysql源码编译安装

    linux下源码编译安装mysql-5.6.25版本

    Linux下源码编译MySQL 5.5 与安装程全记录

    在Linux环境下,源码编译安装MySQL 5.5是一个涉及多步骤的过程,这通常是为了获得更高的定制性和针对特定系统的优化。以下是一个详尽的步骤指南: 首先,我们需要准备必要的工具和依赖。从5.5版本开始,MySQL的源码...

    Qt Mysql linux驱动编译.docx

    1. 修改`mysql.pro`文件: - 添加`CONFIG+=debug_and_release`,这样可以同时编译调试和发布版本。 - 注释掉`#QMAKE_USE += mysql`,因为我们不使用默认的设置。 - 添加`INCLUDEPATH += /usr/local/mysql/include...

    linux下编译安装Apache.MySQL.PHP环境借鉴.pdf

    Linux下编译安装Apache、MySQL、PHP环境借鉴 本文档主要讲述了在Linux系统下编译安装Apache、MySQL、PHP环境的步骤和注意事项,以便读者能够正确地安装和配置该环境。 一、前提条件 在开始安装之前,需要满足以下...

    各版本mysql.data.dll文件

    4. **项目引用**:在.NET项目中,通常需要将MySQL.Data.dll添加为引用,这样编译后的程序才能找到并使用它。可以通过“项目”->“添加引用”->“浏览”选项,选择正确的MySQL.Data.dll文件来完成引用。 5. **API与...

    Centos116.7+MySQL5.7.16源码编译安装.docx

    Centos116.7+MySQL5.7.16源码编译安装.docx

    Centos116.7+MySQL5.7.16源码编译安装.pdf

    Centos116.7+MySQL5.7.16源码编译安装.pdf

    linux下编译安装Apache.MySQL.PHP环境.pdf

    cp support-files/mysql.server /etc/init.d/mysqld ``` 6. 添加服务并设置启动级别: ``` chkconfig --add mysqld chkconfig --level 35 mysqld on chkconfig --list mysqld service mysqld start ``` ...

    Centos6.7+MySQL5.7.16源码编译安装.doc

    Centos6.7+MySQL5.7.16源码编译安装.doc

    C#连接mysql的Mysql.data.dll 5.0.8.1和6.2.1.0

    为了实现C#与MySQL之间的通信,开发人员需要依赖特定的驱动程序,这就是Mysql.data.dll的角色。本篇文章将详细探讨如何使用C#连接MySQL数据库,特别是针对Mysql.data.dll版本5.0.8.1和6.2.1.0。 首先,`Mysql.data....

    Linux5下源码编译mysql5.6实践.docx

    在Linux5系统中,源码编译MySQL 5.6是一项技术性较强的任务,它涉及到对操作系统、编译工具和数据库软件的深入了解。本实践教程将带你一步步完成这个过程,确保你能够在本地环境中成功安装MySQL 5.6。首先,我们需要...

    linux下编译安装Apache.MySQL.PHP环境参考.pdf

    cp support-files/mysql.server /etc/init.d/mysqld chkconfig --add mysqld chkconfig --level 35 mysqld on service mysqld start ``` **PHP** PHP是一种广泛使用的服务器端脚本语言,用于动态网页开发。获取PHP...

    mysql5.1在linux下的编译安装.docx

    MySQL 5.1在Linux下的编译安装是一个涉及多个步骤的过程,主要分为以下几个阶段: 1. 安装前的准备: 在开始安装MySQL之前,需要确保Linux系统环境已经安装了必要的编译工具,例如GCC(GNU Compiler Collection)...

    linux centos 编译安装Mysql.zip

    如果你想要TCP/IP和Unix套接字,添加`--with-socket=/var/lib/mysql/mysql.sock`: ``` cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_ARCHIVE_STORAGE_...

    mysql.data.dll

    MySQL数据访问库MySQL.data.dll是用于连接和操作MySQL数据库的关键组件,主要在.NET环境中使用,如Visual Studio(VS)项目。这个DLL文件包含了.NET开发者所需的API,使得他们能够通过C#、VB.NET或其他.NET支持的...

    各版本Mysql.Data.dll官方整理下载

    MySQL.Data.dll是MySQL数据库连接器的核心组件,用于.NET应用程序与MySQL服务器进行通信。这个压缩包包含从1.0版本到6.9.8版本的MySQL.Data.dll,这是一系列逐步发展的版本,每个版本都可能引入了新的功能、性能优化...

    mysql.data.dll(.net 4.0或以前版本)

    除了基本的数据库连接和查询操作,MySql.Data.dll还支持预编译的SQL语句(`MySqlCommand.Prepare()`)、参数化查询(`MySqlParameter`类)、事务处理(`MySqlTransaction`类)以及更高级的数据库操作,例如存储过程...

Global site tag (gtag.js) - Google Analytics