已阅读5页,还剩1页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
使用cmake编译安装mysql数据库首先准备cmake包cmake-.tar.gz和mysql包mysql-5.5.21.tar.gz,可以分别从以下链接下载得到cmake包:/cmake/resources/software.ht mysql包:/archives.php一、首先安装cmake组件rootcentos upload# tar -zxvf cmake-.tar.gzrootcentos upload# cd cmake-rootcentos cmake-# ./configure运行./configure,如果此时报以下错误Error when bootstrapping CMake:Cannot find appropriate C compiler on this system.Please specify one using environment variable CC.See cmake_bootstrap.log for compilers attempted.则是因为未安装开发工具所致,此时可以直接配置yum库,安装Development tools rootcentos # yum -y groupinstall Development tools再次运行./configurerootcentos cmake-# ./configurerootcentos cmake-# make & make installrootcentos cmake-# which cmake/usr/local/bin/cmake安装成功!二、安装mysql软件1、首先检查系统中是否有默认的mysqlrpm -qa | grep mysql*如果有,则先将其卸载rpm -e 命令卸载2 以root身份创建mysql组,以及mysql用户rootcentos # groupadd mysqlrootcentos # useradd -g mysql mysqlrootcentos # passwd mysql3 安装mysql-5.5.21软件解压rootcentos mysql55# tar -zxvf mysql-5.5.21.tar.gz配置安装rootcentos mysql55# cd mysql-5.5.21rootcentos mysql-5.5.21# cmake . -DCMAKE_INSTALL_PREFIX=/u01/mysql55 -DSYSCONFDIR=/u01/data -DMYSQL_DATADIR=/u01/data -DMYSQL_UNIX_ADDR=/u01/tmp/mysqld.sock -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_TCP_PORT=33061 -DWITH_EXTRA_CHARSETS=all -DWITH_DEBUG=0 -DENABLE_DEBUG_SYNC=0 -DWITH_SSL=bundled -DWITH_ZLIB=system -DWITH_READLINE=1 -DZLIB_INCLUDE_DIR=/u01/mysql55 -DWITH_READLINE=1此时出现报错: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:268 (MYSQL_CHECK_READLINE)- Configuring incomplete, errors occurred!解决方法:如错误信息所说,首先删除CMakeCache.txt文件然后打上ncurses-develrootcentos mysql-5.5.21# rm -rf CMakeCache.txtrootcentos mysql-5.5.21# yum -y install ncurses-devel然后再次cmake安装这次没有报错OK,继续rootcentos mysql-5.5.21# make & make install这个过程可能会需要几分钟的时间4 运行./mysql_install_db 生成授权表 rootcentos u01# chown -R mysql:mysql /mysql55rootcentos mysql55# su - mysqlmysqlcentos $ cd /u01/mysql55/mysqlcentos mysql55$ cp scripts/mysql_install_db .mysqlcentos mysql55$ ./mysql_install_db5 创建相关的文件 rootcentos u01# cd log/rootcentos log# touch error.logrootcentos log# touch slowquery.logrootcentos log# touch mysql.logrootcentos log# mkdir mysql-binrootcentos log# chown -R mysql:mysql /u01rootalee tmp# touch /u01/tmp/mysqld.sock6 复制创建数据库参数文件frootcentos mysql55# cp support-files/f /etc/f7 配置数据库相关参数rootcentos etc# chown mysql:mysql ftips:具体参数值需参考实际环境配置为准rootcentos etc# vi fmysqldserver-id = 1161default-storage-engine = MYISAM #默认myisam存储引擎relay-log = relay-binrelay-log-index = relay-binreplicate-ignore-db = mysqlreplicate-ignore-db = information_schemareplicate-ignore-db = performance_schemaport = 33061socket = /u01/tmp/mysqld.sockskip-external-lockingskip-name-resolvefederatedevent_scheduler = ONkey_buffer_size = 100Mmax_allowed_packet = 16Mtable_open_cache = 1024sort_buffer_size = 4Mread_buffer_size = 2Mread_rnd_buffer_size = 8Mmyisam_sort_buffer_size = 64Mthread_cache_size = 200query_cache_size = 124Mwait_timeout = 15max_connections = 300datadir = /u01/datamax_connect_errors = 10max_heap_table_size = 2Ggroup_concat_max_len = 102400tmp_table_size = 1G等等8 配置相关启动服务rootcentos mysql55# cp -r support-files/mysql.server /etc/init.d/mysqlrootcentos mysql55# cd /etc/rc.d/init.d/rootcentos init.d# chmod +x mysqlrootcentos init.d# chkconfig mysql on (设置开机启动)rootcentos init.d# service mysql startservice mysql start 执行之后,报错了Starting MySQL. ERROR! The server quit without updating PID file (/u01/data/.pid).查看进程并没有僵死的进程rootcentos mysql55# ps aux | grep mysql查看error.log 发现./u01/mysql55/bin/mysqld: File /u01/log/mysql-bin.000006 not found (Errcode: 13)130429 1:09:18 ERROR Failed to open log (file /u01/log/mysql-bin.000006, errno 13)130429 1:09:18 ERROR Could not open log file130429 1:09:18 ERROR Cant init tc log130429 1:09:18 ERROR Aborting130429 1:09:18 InnoDB: Starting shutdown.130429 1:09:19 InnoDB: Shutdown completed; log sequence number 1595668.检查后发现/u01/log下边的文件权限不对-rw-rw- 1 root root 29686 Apr 29 01:09 mysql-bin.000005-rw-rw- 1 root root 1030646 Apr 29 01:09 mysql-bin.000006改正rootcentos log# chown -R mysql:mysql /u01重新启动服务rootcentos log# service mysql startStarting MySQL. SUCCESS!OK,启动成功tips:我在自己做的时候,这个地方的报错,每次似乎不太一样,鉴于本人的能力有限,并不能很好的总结,希望高手多多指教。9 测试登陆一下rootcentos log# mysql -uroot -p-bash: mysql: command not found又报错了解决方法:(加上链接)rootcentos log# cd /usr/local/binrootcentos bin# ln -fs /u01/mysql55/bin/mysql mysqlrootcentos bin# ln -fs /u01/mysql55/bin/mysqladmin mysqladmin创建密码,再次测试:rootcentos bin# mysqladmin -uroot password mysqlrootcentos bin# mysql -uroot -pEnter password: Welcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 3Server version: 5.5.21-log Source distributionCopyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 终末期肾脏病的护理
- 大脑前动脉斑块的护理
- 2026年金华兰溪市卫健系统第一批面向高校招聘医学类应届毕业生17人历年真题汇编及答案解析(夺冠)
- 2025年12月广东深圳中学光明科学城学校(集团)面向2026年应届毕业生招聘教师11人(深圳定点)历年真题汇编附答案解析
- 2026年劳务员之劳务员基础知识考试题库200道含答案(基础题)
- 浙江国企招聘-2025丽水青田县旅游发展有限公司劳务工作人员7人历年真题汇编及答案解析(夺冠)
- 2026航天科技校招提前批招聘备考题库附答案
- 2026年设备监理师之设备工程监理基础及相关知识考试题库200道及完整答案1套
- 2026年初级经济师之初级经济师财政税收考试题库300道附答案(培优a卷)
- 2026年质量员之土建质量基础知识考试题库带答案(培优)
- 微信影响下的珠宝购买决策-洞察及研究
- 绿色农业发展培训课件
- 国有企业问责管理制度及实施细则(草稿)
- 中医内科脾胃系临床思维
- 打造健康和谐的同伴关系
- 神经内科介入术后护理
- 《HJ 212-2025 污染物自动监测监控系统数据传输技术要求》
- 大学生人际关系与心理健康教育
- 徐工XCT75起重机详细参数说明
- 安全生产主要责任人任命书
- 加速康复外科理念下骨盆骨折诊疗规范的专家共识
评论
0/150
提交评论