[mythtv-users] converting a .20.2 database to .21

Michael T. Dean mtdean at thirdcontact.com
Wed May 7 20:17:58 UTC 2008


On 05/07/2008 04:06 PM, scram69 wrote:
> On Wed, May 7, 2008 at 11:45 AM, Michael T. Dean wrote:
>   
>>  Note, though, you need to have a 0.20.2 database in place for the
>>  upgrade to work.  That means you need to do the restore of your 0.20.2
>>  database into an /empty/ database (i.e. the one create by passing mc.sql
>>  to the mysql command-line client--
>>  http://mythtv.org/docs/mythtv-HOWTO-6.html#ss6.2 ).  So, don't run
>>  mythtv-setup or mythbackend before doing the restore.  If you (or
>>  someone else--such as a packager script) does run it, you'll need to
>>  issue the command, "DROP DATABASE mythconverg;" to MySQL and then
>>  create the initial database, as above (in #ss6.2).
>>     
> Actually, I had planned on running/testing 0.21 on my "dev" partition
> first, to make sure it plays nice with 0.21 on my main frontend, which
> is OS X.  So I had anticipated needing to drop the existing database
> once I wanted to "go live".
> However, in the past, I have not had to use mc.sql to create an empty
> database.  After the drop command, I follow
> http://mythtv.org/docs/mythtv-HOWTO-23.html#ss23.5
> and do:
>     $ mysql -u root
>     mysql>create database mythconverg;
>     mysql>exit
>     $ mysql -u mythtv -pmythtv mythconverg < mythtv_backup.sql
> Then, I would run mythtv-setup.
> If I do this, is the mc.sql step still necessary?

Your use of "CREATE DATABASE mythconverg;" would /only/ work on a MySQL 
installation where an appropriate user has been created.  Also, it's 
likely to cause character set issues (though, now, Myth's database 
upgrade code does it's best to prevent the issues even on an 
improperly-configured database).

The mc.sql script does more than just create the mythconverg database.  
It a) creates the DB, b) creates a user mythtv, c) grants appropriate 
permissions to the mythtv user, and d) sets the database character set.  
As long as you do all these things (where the user/grants part will 
"stick" even after a "DROP DATABASE", so they need only be done when 
first setting up MythTV on the MySQL server), everything is good.  
However, it /never/ hurts to run the commands in mc.sql (even if the 
database already exists).***

Mike

***Never say, "Never."  In truth, if you're running trunk and you run 
mc.sql with a working mythconverg database, you may cause character set 
issues, but, hey, trunk isn't really ready for production use, yet, anyway.


More information about the mythtv-users mailing list