Search code examples
phpmysqlmysqlnd

Will installing mysqlnd break existing code in PHP which uses mysql?


I'm moving my code from using mysql in PHP to mysqli. In order to get the mysqli get_result() function to work I need to install mysqlnd as said here on SO. This involves removing the existing php-mysql extension, and now I just want to make sure (those of you who did this) that once I remove the mysql with:

yum remove php-mysql

and install mysqlnd with:

yum install php-mysqlnd

the other code (there's a lot of existing codebase) that uses mysql will still work?

My PHP Version is 5.3.27


Solution

  • I would like to generally answer that NO it's not safe to just remove php-mysql and install php-mysqlnd, especially if you're not "a server guy". Because once I removed php-mysql I removed phpmyadmin along with it and that was quite a disaster.

    I ended up (with help of Rackspace server guys) with upgrading my PHP to 5.4 (can't go to 5.5 yet until I convert all my code to use mysqli) and then manually forcing the install of php54-mysqlnd-5.4.17-1.ius.el6.x86_64 (http://dev.mysql.com/downloads/connector/php-mysqlnd/), because of the error while trying to do it "the normal way" Error: php54-mysql conflicts with php54-mysqlnd-5.4.17-1.ius.el6.x86_64. Hope this helps someone.