Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved!] Myth 0.20 & mysql error on new machine
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
dspahn
Guru
Guru


Joined: 22 Jun 2006
Posts: 392

PostPosted: Thu Jan 04, 2007 4:19 am    Post subject: [Solved!] Myth 0.20 & mysql error on new machine Reply with quote

My myth box is "new"- I just set it up to be dedicated to Myth. I have not yet successfully run Mythtv yet. I have the correct settings to connect to the database, and I get a successful connection message. It's worth mentioning that the database is on a dedicated mysql server, seperate from the myth box. The first error I notice that looks like any form of malcontent says "Told to create a NEW database schema, but the database already has 2 tables. If you are sure that this is a good mythtv database, verify that the settings table has the DBSchemaVar variable." Then "Database Schema upgrade FAILED, unlocking. Couldn't upgrade to database to new schema, exiting.
No such file or directory
apps file failure"

Any ideas how to fix this database?

Thanks!


Last edited by dspahn on Fri Jan 05, 2007 2:18 pm; edited 1 time in total
Back to top
View user's profile Send private message
Hobbes-X
l33t
l33t


Joined: 04 Feb 2004
Posts: 823
Location: Seattle, WA

PostPosted: Thu Jan 04, 2007 3:51 pm    Post subject: Reply with quote

This usually happens when a database upgrade is interupted, or in your case, the initial database setup.

It's safe to delete all the tables in the mythconverg database, assuming that you haven't done anything important you want to keep settings wise since you've moved to the new sql server.

Importing mc.sql only creates the database and the initial permissions, mythbackend handles all of the table creation by checking the settings table for a schema version. If it's not there but you have tables, it pukes rather than wipe the database and loose potentialy desired info. You're starting from scratch, so a database wipe should be okay. Deleting the tables is preferable to re-importing mc.sql, since you've got your permissions set correctly.

If you've got some settings already configured on the first myth box you setup, it should be safe to copy the mythconverg database over to the new server too. If you don't, it's not a huge deal, you'll just be starting with the default settings again.
Back to top
View user's profile Send private message
dspahn
Guru
Guru


Joined: 22 Jun 2006
Posts: 392

PostPosted: Thu Jan 04, 2007 4:01 pm    Post subject: What commands to run? Reply with quote

I confess that I am a n00b at mySQL datbase manipulation. I went to the Myth website and ran the appropriate "drop" command, which I thought did that. After dropping the mythconverg database, I ran the command to feed mysql the myth db script (something like mc.sql?). What should I do to wipe it clean?
FWIW, I have no information that I care about, so I don't care what happens to the database.
Thanks for the help!
Back to top
View user's profile Send private message
Hobbes-X
l33t
l33t


Joined: 04 Feb 2004
Posts: 823
Location: Seattle, WA

PostPosted: Thu Jan 04, 2007 5:25 pm    Post subject: Reply with quote

EDIT: Just ran into one other possible hangup- apparently a backend will automatically try and connect through the local mysql socket first, regardless of the mysql.txt settings? The myth docs say it's required to not run the mysql service on a backend machine that isn't also serving MySql.

It might be easiest to start from the beginning:

Make sure you're running on the standalone mysql server (since the command interpreter defaults to localhost, and you want to make sure it drops the database on the correct system), and then run:
Code:

$ mysql -u root -p
mysql> drop database mythconverg;
mysql> quit


Then, import mc.sql again to re-create the database:
Code:

$ su
# mysql < /usr/share/mythtv/database/mc.sql


Then, you should probably make sure that permissions are set correctly so that your network can access the mysql server. This assusmes that your IP addresses are in the 192.168.1.* subnet, if not you'll need to change the IP address portion of it:
Code:
$ mysql -u root -p mythconverg
mysql> grant all on mythconverg.* to mythtv@"192.168.1.%" identified by "mythtv";
mysql> flush privileges;


Then, make sure that your backend is connecting to the correct machine by editing mysql.txt and changing the hostname to the IP address of the mysql server. Like I mentioned in my post in your other thread, make sure that you're changing the correct mysql.txt:
Code:

hobbesx hobbes # locate mysql.txt
/etc/mythtv/mysql.txt
/home/hobbes/.mythtv/mysql.txt
/home/myth/.mythtv/mysql.txt
/myth/netboot/shuttle/home/myth/.mythtv/mysql.txt
/myth/netboot/paul/home/myth/.mythtv/mysql.txt
/usr/share/mythtv/mysql.txt


By default, myth will use the mysql.txt in the current users's home directory, but if you're not sure which one is getting used, you can run
Code:
# mythbackend --verbose file

and it should report where it's pulling it from.
Back to top
View user's profile Send private message
Hobbes-X
l33t
l33t


Joined: 04 Feb 2004
Posts: 823
Location: Seattle, WA

PostPosted: Thu Jan 04, 2007 5:32 pm    Post subject: Reply with quote

One other note, while you're here...

All the other myth related programs pull from the mysql.txt, so if you run mythfilldatabase manually from the command line, make sure that you've got the correct settings in the current users' ~/.myth/mysql.txt too. Running mythfilldatabase on a machine that isn't local incurrs a performance hit too (It's faster on the local machine). It might be worth installing myth on the mysql server just to run mythfilldatabase.
Back to top
View user's profile Send private message
dspahn
Guru
Guru


Joined: 22 Jun 2006
Posts: 392

PostPosted: Thu Jan 04, 2007 8:04 pm    Post subject: Not a bad idea... Reply with quote

I may do that. I shied away from it before because first I needed to emerge Myth, then it wanted to pull in QT.... and so on. I ran most of the commands you posted right before I started getting that error, but your commands are subtly different... I'll let you know tonight after i have some results to post. As always, thanks for your help.
Back to top
View user's profile Send private message
Hobbes-X
l33t
l33t


Joined: 04 Feb 2004
Posts: 823
Location: Seattle, WA

PostPosted: Thu Jan 04, 2007 8:28 pm    Post subject: Re: Not a bad idea... Reply with quote

dspahn wrote:
I may do that. I shied away from it before because first I needed to emerge Myth, then it wanted to pull in QT.... and so on.

Yeah, I understand that, especially now that I'm trying to keep three boxes at home updated :)

Quote:
I ran most of the commands you posted right before I started getting that error, but your commands are subtly different... I'll let you know tonight after i have some results to post. As always, thanks for your help.


Chances are what you ran was functionally equivalent :D Perhaps the the lines to start mysql were different, but as long as the statements don't fail, it shouldn't matter. I'll check back again tonight to see how things turn out.[/quote]
Back to top
View user's profile Send private message
dspahn
Guru
Guru


Joined: 22 Jun 2006
Posts: 392

PostPosted: Fri Jan 05, 2007 3:31 am    Post subject: Error! Reply with quote

From /var/log/mythtv/mythbackend.log:
Quote:
QSqlQuery::exec: database not open


Other symptoms include mythbackend is halfway up, mythbackend listed as stopped in rc-status, but restarting mythbackend says the service is stopping, then starting. Myth won't run (the "is mythbackend running?" dialog).

The directions you gave did resolve the initial connection problem. Any ideas on how to get Mythbackend working? I'm going to go back and double-check all the permissions and settings in the various walkthroughs. I appreciate anything you come up with.
Thanks!

edit: I went back and ran slocate mysql.txt and found one buried in /etc/mythtv/.mythtv/mysql.txt. I changed the localhost line to the hostname of my mysql server and mythbackend came up... I'll update with the results of my testing shortly.

edit: Success! Now to work out the rest of the system! You'll see more posts as it develops. :roll:
Back to top
View user's profile Send private message
Hobbes-X
l33t
l33t


Joined: 04 Feb 2004
Posts: 823
Location: Seattle, WA

PostPosted: Fri Jan 05, 2007 2:16 pm    Post subject: Re: Error! Reply with quote

dspahn wrote:
edit: Success! Now to work out the rest of the system! You'll see more posts as it develops. :roll:


Heh, not a problem, happy to be of some help :) One thing that can help is running mythbackend straight from the command line- that way there's no need to run it, then check the logs. Not a whole lot of good for diagnosing problems that need extra debug output, but it helps if mythbackend is dying on startup.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum