linux|linux mysql 提领类型双关的指针将破坏强重叠规则_linux 下 源码编译 mysql.5.19

说明: 本文需要的软件都可以在自由软件库下载到 http://download.chinaunix.net/RPM包和源码包存放位置 /usr/local/src 源码包编译安装位置(prefix) /usr/local/xxx 脚本以及维护程序存放位置 /usr/local/sbin MySQL 数据库位置 /var/lib/mysql Apache 网
今天安装在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
【linux|linux mysql 提领类型双关的指针将破坏强重叠规则_linux 下 源码编译 mysql.5.19】重新编译安装
[ 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................. [确定]

    推荐阅读