![]() |
Database Utility - Backups Not Working with MySQLi - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Database Utility - Backups Not Working with MySQLi (/showthread.php?tid=43705) |
Database Utility - Backups Not Working with MySQLi - El Forum - 07-20-2011 [eluser]TomRPS[/eluser] I am getting the error: Code: Unsupported feature of the database platform you are using. When trying to export a database backup using the db utility class. Export works OK with MySQL driver. Is there any way I can export the database when using the MySQLi driver? Or how can I switch the driver just for the export? Database Utility - Backups Not Working with MySQLi - El Forum - 02-14-2012 [eluser]resolv_25[/eluser] Same error on CI 2.1, mysql works properly, but mysqli driver in database.php produces such error. Database Utility - Backups Not Working with MySQLi - El Forum - 01-11-2013 [eluser]Tim Post[/eluser] This is actually not implemented in the Mysqli driver. If you look at: Code: system/database/drivers/mysqli/mysqli_utility.php You'll see the stub: Code: /** As PHP has begun the deprecation of the mysql_* family of functions, it's probably a good idea to implement this in the not too distant future ![]() Database Utility - Backups Not Working with MySQLi - El Forum - 10-25-2014 [eluser]Unknown[/eluser] This works for me and it's probable that it would work for other people also. Not sure if it covers all cases (i.e. not so common field types). Based on what Tim Post said, I decided to rewrite _backup() for mysqli driver, using old _backup() from mysql driver as template. I know, this is not the desirable way of solving this, but it is the quickest thing I found right now (I am writing this post in the middle of a long night). I will try to overwrite the method in an own library. Let you know if I found a way. Code: /** Database Utility - Backups Not Working with MySQLi - El Forum - 10-25-2014 [eluser]Unknown[/eluser] Probably you would face the same problem than me if you are trying to export BIG tables. Here you are a quick workaround. Replace this... Code: // Grab all the data from the current table with this... Code: // Grab all the data from the current table - in slices of 1000 records ... and then, replace this... Code: $output .= $newline.$newline; with this... Code: $output .= $newline.$newline; Database Utility - Backups Not Working with MySQLi - El Forum - 10-27-2014 [eluser]www.sblog.in[/eluser] Example http://www.webtuts.in/backup-site-and-database-in-codeigniter/ |