设为首页 收藏本站
查看: 600|回复: 0

[经验分享] MySQL 错误总结

[复制链接]

尚未签到

发表于 2018-10-3 10:37:35 | 显示全部楼层 |阅读模式
  最近心情不怎么好,跟着blog打字都老是打错,安装MySQL积累了几个错误并在网上找到了解决问题的错误,今天贴出来与大家共享,有解释不清楚的地方还请各位多提宝贵意见。
  问题1. configure: WARNING: unrecognized options: --with-innodb 这个是用源码包构建LAMP编译安装mysql时提示的warning信息 ./configure --help 么有--with-innodb 选项
  解决方法:要用--with-plugins安装
  --with-plugins=PLUGIN[[[,PLUGIN..]]]
  Plugins to include in mysqld. (default is: none)
  Must be a configuration name or a comma separated
  list of plugins.
  Available configurations are: none max max-no-ndb
  all.
  Available plugins are: partition daemon_example
  ftexample archive blackhole csv example federated
  heap innobase myisam myisammrg ndbcluster.

    英语不好,只供参考,大概意思是
  把插件安装到mysqld里。(默认值:none)
  只能是配置名或者用逗号分隔插件名
  有效的配置名:none max max-no-ndb all.
  有效的插件名:partition daemon_example ftexample archive blackhole csv example federated heap innobase myisam myisammrg
  好的,使用 --with-plugins=partition,blackhole,heap,innobase,myisam,ndbcluster 就没问题了。
  问题2.  安装mysql,在./configure 时出现错误:“error:No curses/termcap library found” &"make;*** No targets specified and no makefile found.stop."
  此时注意查看./configure 时出现的错误提示 如下
  checking for tgetent in -lncurses... no
  checking for tgetent in -lcurses... no
  checking for tgetent in -ltermcap... no
  checking for tgetent in -ltinfo... no
  checking for termcap functions library... configure: error: No curses/termcap library found
  原因:缺少ncureses安装包  解决方法:
  (1)redhat 系列
  #yum list|grep ncurses
  #yum -y install ncurses-devel
  (2)ubuntu/debian 系列
  $apt-cache search ncurses
  $apt-get install libncurses5-dev
  待安装completed 后,重新./configure 就可以了~
  问题3:mysql+php 错误及解决方法
  记得原来在编译php的已经已经加上参数
  --with-mysql=/usr/local/mysql \
  --with-mysqli=/usr/local/mysql/bin/mysql_config \
  可后来找了一个,的确不存在mysqli.so,所以只能单独来编译mysqli了。
  mysqli是优化过的mysql函数库,MYSQL版本不能低于4.1.12
  cd /root/tmp/php-5.2.3/ext/mysqli
  #####进入到mysqli的目录。
  再用phpize生成configure文件:
  /usr/local/bin/phpize
  Configuring for:
  PHP Api Version:         20041225
  Zend Module Api No:      20060613
  Zend Extension Api No:   220060519
  #./configure --prefix=/usr/local/mysqli --with-php-config=/usr/local/bin/php-config --with-mysqli=/usr/bin/mysql_config
  make
  make install
  Installing shared extensions:     /usr/local/lib/php/extensions/debug-non-zts-20060613/
  然后在/usr/local/lib/php.ini
  加上一句:
  extension=/usr/local/lib/php/extensions/no-debug-non-zts-20060613/mysqli.so
  重新启动apache即可看到已经加载mysqli成功。
  1、如果出现出错代码:
  /root/tmp/php-5.2.3/ext/mysqli/mysqli.c: In function 'zm_startup_mysqli':
  /root/tmp/php-5.2.3/ext/mysqli/mysqli.c:637: error: 'MYSQL_RPL_MASTER' undeclared (first use in this function)

  /root/tmp/php-5.2.3/ext/mysqli/mysqli.c:637: error: (Each undeclared>  /root/tmp/php-5.2.3/ext/mysqli/mysqli.c:637: error: for each function it appears in.)
  /root/tmp/php-5.2.3/ext/mysqli/mysqli.c:638: error: 'MYSQL_RPL_SLAVE' undeclared (first use in this function)
  /root/tmp/php-5.2.3/ext/mysqli/mysqli.c:639: error: 'MYSQL_RPL_ADMIN' undeclared (first use in this function)
  *** Error code 1
  修改一下这个文件就可以
  cd /usr/include/mysql
  root@www[/usr/include/mysql]# vi mysql.h
  在第221行
  ... ...
  enum mysql_protocol_type
  {
  MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
  MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
  };
  /*
  There are three types of queries - the ones that have to go to
  the master, the ones that go to a slave, and the adminstrative
  type which must happen on the pivot connectioin
  */
  #添加下面的4行
  enum mysql_rpl_type
  {
  MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN
  };
  2、如果出现以下错误:
  /root/tmp/php-5.2.3/ext/mysqli/mysqli_api.c: In function 'zif_mysqli_stmt_bind_param':
  /root/tmp/php-5.2.3/ext/mysqli/mysqli_api.c:144: error: 'gptr' undeclared (first use in this function)

  /root/tmp/php-5.2.3/ext/mysqli/mysqli_api.c:144: error: (Each undeclared>  /root/tmp/php-5.2.3/ext/mysqli/mysqli_api.c:144: error: for each function it appears in.)
  /root/tmp/php-5.2.3/ext/mysqli/mysqli_api.c: In function 'zif_mysqli_stmt_execute':
  /root/tmp/php-5.2.3/ext/mysqli/mysqli_api.c:603: error: 'gptr' undeclared (first use in this function)
  make: *** [mysqli_api.lo] 错误 1
  修改一下这个文件就可以
  vi mysqli_api.c
  查找所有gptr,有四处分别位于行144、行150、行603、行607,以 char* 替换
  测试Mysqli运行状况:
  Vim mysqli.php
  
  问题4:./configure:error:MySQL library not found
解决方法:#yum install mysql-devel 重新 编译安装zabbix  ./configure --enable-server --enable-proxy --enable-agent --with-mysql=/usr/lib/mysql/mysql_config --with-net-snmp --with-libcurl --prefix=/usr/local/zabbix  即可
  至此peace遇到的mysql的问题及解决方法已告一段落,快乐学习,快乐分享~
  http://blog.sina.com.cn/s/blog_6458f3150100s7a9.html
  http://blog.csdn.net/zccst/article/details/4493074
  http://hky008.blog.51cto.com/803965/487563


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-608864-1-1.html 上篇帖子: mysql job 设置 下篇帖子: mysql crash recover-IT技术贴
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表