Posts

Showing posts with the label mysql

Shoretel CDR Database Schema Upgrade 19.XX to 21.82

Schema Upgrade Script Before Import Old Records Immediately after upgrading from Shoreware 19.XX to Shoreware 21.82, you will want to import your old CDR records.  Before you can do that, you must upgrade the old CDR records by adding some new fields.  My upgrade script will take your old CDR and add those fields.  To use it, import your old CDR into a stand-alone mysql instance and then upgrade it using my handy script, then export it out, finally import the records into your Shoreware director. Create a Stand-alone Instance of the CDR database 1 2 3 4 5 drop database shorewarecdr; CREATE DATABASE shorewarecdr; GRANT ALL ON shorewarecdr.* TO st_cdrreport@localhost IDENTIFIED BY 'passwordcdrreport' ; GRANT ALL ON shorewarecdr.* TO `root`@` 127 . 0 . 0 . 1 ` IDENTIFIED BY 'passwordcdrreport' ; FLUSH PRIVILEGES ; Upgrade the old CDR 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32...

A MySQL Wrapper for mysqli - old skool mysql

Image
A Wrapper for mysqli to Enable Old Skool Mysql Get this cool mysql wrapper from github to retrofit your old skool mysql / php code to work on php7 where mysql has been replaced by mysqli.   If you are seeing this error in your old php5 code, and you have calls to old mysql functions all of the place, you can quickly retrofit your programs. 1 2 3 4 5 6 7 PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /opt/bitnami/apache2/htdocs/lib/class.db.php:29 Stack trace: #0 /opt/bitnami/apache2/htdocs/lib/class.db.php(24): Db->connect() #1 /opt/bitnami/apache2/htdocs/common/config.php(21): Db->Db('localhost', 'dbadmin', 'Sick1234', 'demodatabase') #2 /opt/bitnami/apache2/htdocs/mysql-test.php(6): include('/opt/bitnami/ap...') #3 {main} thrown in /opt/bitnami/apache2/htdocs/lib/class.db.php on line 29 where line 29 has this bit of code 27 28 29 30 31 32 33 34 35 36 37 38 39 4...

How to Restore Legacy mysql to php7 - when you really hate mysqli

How to put MySQL functions back into PHP 7 PHP 7 will go “release candidate” on August 20th 2015 which is very exciting because it will instantly be twice as fast as PHP 5.6 (and all previous versions). PHP7 gives HHVM a run for the money and takes 5 minutes to compile instead of hours for HHVM. But there is a catch – if you have any legacy code that uses the  mysql_*  functions, they will stop working entirely in PHP 7. Not just a warning, not just deprecated, but gone, fatal. Sorry guys. However, there is another work around to restore your old mysql without breaking the bank.  My other alternative is to use a mysqli wrapper. See my other blog post :. However, it is easy to get them back without using a wrapper or modifying your code… I wouldn’t plan on using this solution far past 2016 but it will keep your legacy code running in the meanwhile. Simply compile the mysql function as a php pecl extension and add one line to your  php.ini First get the...