Welcome 微信登录

首页 / 数据库 / MySQL / Python中使用MySQL的问题

第一步:安装MySQL-python-1.2.2.tarpython setup.py build
python setup.py intstall第二步:可能遇到的错误1、libmysqlclient.so.16: cannot open shared object file: No such file or directory需要安装新的包mysqlclient16-5.1.30-1.el5.remi.i386或者通过ln -s设置链接2、 在build的时候需要按照setuptools-0.6b1-py2.4.egg包% wget -q http://peak.telecommunity.com/dist/ez_setup.py% python ez_setup.py
  Downloading http://cheeseshop.python.org/packages/2.4/s/
  setuptools/setuptools-0.6b1-py2.4.egg#md5=b79a8a403e4502fbb85ee3f1941735cb
  Processing setuptools-0.6b1-py2.4.egg
  creating /sw/lib/python2.4/site-packages/setuptools-0.6b1-py2.4.egg
  Extracting setuptools-0.6b1-py2.4.egg to /sw/lib/python2.4/site-packages
  Removing setuptools 0.6a11 from easy-install.pth file
  Adding setuptools 0.6b1 to easy-install.pth file
  Installing easy_install script to /sw/bin
  Installing easy_install-2.4 script to /sw/bin  Installed /sw/lib/python2.4/site-packages/setuptools-0.6b1-py2.4.egg
  Processing dependencies for setuptools这个按照需要上网,需要设置网络环境ip地址+DNS。3  EnvironmentError: mysql_config not foundMySQL-python-1.2.2]# vi setup_posix.py
26 mysql_config.path = "/usr/local/mysql/bin/mysql_config"
将26行改为mysql_config的真是路径
再次执行python setup.py build;python setup.py install
就OK了4 /usr/bin/ld: cannot find -lmysqlclient_r
 解决方法一(已经测试通过)执行以下命令:echo “/usr/local/mysql/lib/mysql” >> /etc/ld.so.conf(我的环境是CentOS 5)ldconfig,执行以后还是提示以上错误。———————–后来看来一下README,原文在下面——————-threadsafe
        thread-safe client library (libmysqlclient_r) if True (default);
        otherwise use non-thread-safe (libmysqlclient). You should
        always use the thread-safe library if you have the option;
        otherwise you *may* have problems.———————————得知得修改site.cfg,将thread-safe设为false,一切OK!python setup.py install解决方法二(没有测试)A thread-safe client library (libmysqlclient_r) will be created automatically during the compilation of MySQL  if the configure command contains the option "--enable-thread-safe-client".
Linux安装Oracle 11时报错DISPLAY解决方案关于MySQL启动的相关总结相关资讯      mysql 
  • 数据库服务器 MySQL  (08/15/2013 06:50:23)
  • MySQL 5.6 GA 及逃亡潮  (02/08/2013 14:36:35)
  • MySQL 5.5.22、5.1.62、5.0.96全线  (03/22/2012 19:03:49)
  • MySQL Administrator连接VMWare下  (05/24/2013 09:20:58)
  • MySQL 5.1.68 发布  (02/05/2013 08:37:47)
  • CentOS 5.2+MySQL+Heartbeat双机互  (01/29/2012 11:16:55)
本文评论 查看全部评论 (0)
表情: 姓名: 字数