Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Understanding Mythtv and my SQL?
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
raid517
l33t
l33t


Joined: 06 Mar 2003
Posts: 946

PostPosted: Mon Aug 02, 2004 11:08 pm    Post subject: Understanding Mythtv and my SQL? Reply with quote

Hi I am having some trouble understanding MyThTV and MySql. Apparently MythTv requires MySql. I have no idea why, but there you are. Well anyway, I need MyThTV in order to view TV on my PC - and since my TV card wasn't so cheap, I'm kind of reluctant to just not use it. I seem to have been ok with installing MythTv and MySQL - and starting MySQL seemed to go OK too - although there were some provisos i didn't quite understand about needing to use an IP address as opposed to a host name due to a potentially incompaticle c library or something. Given that I am not even sure what MySql is, or what it does I am sorry to say that this means nothing to me.

Can anyone please take a look at the below output and tell me in plain english what it is asking me to do?

I am not too familiar with the concept of host names etc either. All i want to do is start MyTV and watch some TV on my new Linux box.

If I do need mysql it would be nice to make sure it is running automatically at boot time too, so I don't have to keep issuing commands to it manually.

Any help anyone can offer in enabling me to do this would be very much appreciated.

The Output I got is as follows:

Quote:
/home/raid516 ;) /etc/init.d/mysql

Gentoo Linux RC-Scripts; http://www.gentoo.org/
Copyright 2001-2003 Gentoo Technologies, Inc.; Distributed under the GPL

Usage: mysql < flags > [ options ]

Options:
start
Start service, as well as the services it depends on (if not already
started).

stop
Stop service, as well as the services that depend on it (if not already
stopped).

restart
Restart service, as well as the services that depend on it.

Note to developers: If this function is replaced with a custom one,
'svc_start' and 'svc_stop' should be used instead of 'start' and
'stop' to restart the service. This is so that the dependencies
can be handled correctly. Refer to the portmap rc-script for an
example.

pause
Same as 'stop', but the services that depends on it, will not be
stopped. This is useful for stopping a network interface without
stopping all the network services that depend on 'net'.

zap
Reset a service that is currently stopped, but still marked as started,
to the stopped state. Basically for killing zombie services.

status
Prints "status: started" if the service is running, else it
prints "status: stopped".

Note that if the '--quiet' flag is given, it will return true if the
service is running, else false.

ineed|iuse
List the services this one depends on. Consult the section about
dependencies for more info on the different types of dependencies.

needsme|usesme
List the services that depend on this one. Consult the section about
dependencies for more info on the different types of dependencies.

broken
List the missing or broken dependencies of type 'need' this service
depends on.

Flags:
--quiet
Suppress output to stdout, except if:

1) It is a warning, then output to stdout
2) It is an error, then output to stderr

--nocolor
Suppress the use of colors.

Dependencies:
This is the heart of the Gentoo RC-Scripts, as it determines the order
in which services gets started, and also to some extend what services
get started in the first place.

The following example demonstrates how to use dependencies in
rc-scripts:

depend() {
need foo bar
use ray
}

Here we have foo and bar as dependencies of type 'need', and ray of
type 'use'. You can have as many dependencies of each type as needed, as
long as there is only one entry for each type, listing all its dependencies
on one line only.

need
These are all the services needed for this service to start. If any service
in the 'need' line is not started, it will be started even if it is not
in the current, or 'boot' runlevel, and then this service will be started.
If any services in the 'need' line fails to start or is missing, this
service will never be started.

use
This can be seen as representing optional services this service depends on
that are not critical for it to start. For any service in the 'use' line,
it must be added to the 'boot' or current runlevel to be considered a valid
'use' dependency. It can also be used to determine startup order.

before
This, together with the 'after' dependency type, can be used to control
startup order. In core, 'before' and 'after' do not denote a dependency,
but should be used for order changes that will only be honoured during
a change of runlevel. All services listed will get started *after* the
current service. In other words, this service will get started *before*
all listed services.

after
All services listed will be started *before* the current service. Have a
look at 'before' for more info.

provide
This is not really a dependency type, rather it will enable you to create
virtual services. This is useful if there is more than one version of
a specific service type, system loggers or crons for instance. Just
have each system logger provide 'logger', and make all services in need
of a system logger depend on 'logger'. This should make things much more
generic.

parallel
This is not really a dependency type, but enable you to specify if a
service can start in parallel or not. It takes one of two arguments,
either 'yes' or 'no', and if it is not specified, it is presumed that
it is set to 'yes'.

Note that the 'need', 'use', 'before' and 'after' dependeny types can have '*'
as argument. Having:

depend() {
before *
}

will make the service start first in the current runlevel, and:

depend() {
after *
}

will make the service the last to start.

You should however be careful how you use this, as I really will not
recommend using it with the 'need' or 'use' dependency type ... you have
been warned!

'net' Dependency and 'net.*' Services:
Example:

depend() {
need net
}

This is a special dependency of type 'need'. It represents a state where
a network interface or interfaces besides lo is up and active. Any service
starting with 'net.' will be treated as a part of the 'net' dependency,
if:

1. It is part of the 'boot' runlevel
2. It is part of the current runlevel

A few examples are the /etc/init.d/net.eth0 and /etc/init.d/net.lo services.

Configuration files:
There are three files which will be sourced for possible configuration by
the rc-scripts. They are (sourced from top to bottom):

/etc/conf.d/basic
/etc/conf.d/mysql
/etc/rc.conf

Management:
Services are added and removed via the 'rc-update' tool. Running it without
arguments should give sufficient help.

/home/raid516 ;) /etc/init.d/mysql start
* You dont appear to have the mysql database installed yet.
* Please run /usr/bin/mysql_install_db to have this done...
/home/raid516 ;) /usr/bin/mysql_install_db
WARNING: The host 'navynos' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Preparing db table
Preparing host table
Preparing user table
Preparing func table
Preparing tables_priv table
Preparing columns_priv table
Installing all prepared tables

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/etc/init.d/mysql start (you have to start the server first!)
/usr/bin/mysqladmin -u root -h navynos password 'new-password'
/usr/bin/mysqladmin -u root password 'new-password'
See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com

/home/raid516 ;) /etc/init.d/mysql start
* Starting mysqld... [ ok ]
/home/raid516 ;) mythtv
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


Code:
Stand-alone shell (version 3.6)
$ mythtv
Unable to connect to database!
Driver error was [1/1045]:
QMYSQL3: Unable to connect
Database error was:
Access denied for user: 'mythtv@localhost' (Using password: YES)

couldn't open db


Best regards,

GJ
Back to top
View user's profile Send private message
El_Presidente_Pufferfish
Veteran
Veteran


Joined: 11 Jul 2002
Posts: 1179
Location: Seattle

PostPosted: Tue Aug 03, 2004 12:50 am    Post subject: Reply with quote

Code:
/etc/init.d/mysql start

the start is important

edit - wait a minute..you have that at the bottom, whats with the big paste then?

mysql is a database system, and mythtv stores the channels and programs in a database using it


Last edited by El_Presidente_Pufferfish on Tue Aug 03, 2004 2:23 am; edited 1 time in total
Back to top
View user's profile Send private message
patsonrt1
Tux's lil' helper
Tux's lil' helper


Joined: 21 Mar 2003
Posts: 104
Location: Somewhere in my head

PostPosted: Tue Aug 03, 2004 1:06 am    Post subject: Reply with quote

You don't have the correct password for mysql set in mythtv. Edit /etc/mythtv/mysql.txt and add the correct mysql password.
Code:
nano /etc/mythtv/mysql.txt
 
DBHostName=USE THE IP# OF YOUR COMPUTER
DBUserName=mythtv
DBPassword=YOUR MYSQL PASSWORD
DBName=mythconverg


To have mysql start on boot do
Code:
rc-update add mysql default


HTH
_________________
"Well fine, go ahead and miss church, and when you die and go to hell you can answer to SATAN!"

"Ok"

-fortune
Back to top
View user's profile Send private message
Quantumstate
Apprentice
Apprentice


Joined: 26 May 2004
Posts: 270
Location: Dallas

PostPosted: Sun Oct 24, 2004 8:31 pm    Post subject: Reply with quote

Well, I'm missing something.

Emerged mysql and initted it via emerge, as recommended. Then:
Code:
# /etc/init.d/mysql start ok
# /usr/bin/mysqladmin -u root -h localhost password 'new-password'
# /usr/bin/mysqladmin -u root password 'new-password'
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: YES)'


So I ran mysql> and manually set that second password.

The next step is supposed to be
Code:
# mysql < /usr/share/mythtv/database/mc.sql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)


So, start over by stopping the server, deleting the databases, and mysql_install_db, etc. Exactly the same syndrome.

Isn't there any straightforward way to use Postgres with Myth? I never have a problem with Postgres, and always do with Mysql.
Back to top
View user's profile Send private message
Quantumstate
Apprentice
Apprentice


Joined: 26 May 2004
Posts: 270
Location: Dallas

PostPosted: Tue Oct 26, 2004 1:36 pm    Post subject: Reply with quote

Has anyone installed Myth lately?
Back to top
View user's profile Send private message
scarr
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jun 2002
Posts: 88
Location: Lebanon, TN

PostPosted: Tue Oct 26, 2004 2:19 pm    Post subject: Reply with quote

MythTV installed great for me.

I believe what you are missing is:

Code:

mysql -u root -p {mythdata} < {script}


If you need anymore help, email or PM me.
_________________
Scott Carr * OpenOffice.org * Documentation Maintainer
http://documentation.openoffice.org
jabber: scarr@progbits.com
Back to top
View user's profile Send private message
scarr
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jun 2002
Posts: 88
Location: Lebanon, TN

PostPosted: Tue Oct 26, 2004 2:21 pm    Post subject: Reply with quote

MythTV uses mysql to store all the shows you have set to record, as well as the tv guide that is downloaded each night.

There is a HOW TO at MythTV Wiki
_________________
Scott Carr * OpenOffice.org * Documentation Maintainer
http://documentation.openoffice.org
jabber: scarr@progbits.com
Back to top
View user's profile Send private message
Quantumstate
Apprentice
Apprentice


Joined: 26 May 2004
Posts: 270
Location: Dallas

PostPosted: Tue Oct 26, 2004 3:06 pm    Post subject: Reply with quote

scarr wrote:
MythTV installed great for me.

I believe what you are missing is:

Code:

mysql -u root -p {mythdata} < {script}


If you need anymore help, email or PM me.


Thanks, but how long ago did you install Myth?.

Yes, the way you have formatted the command worked. Unfortunately this is not in the instructions anywhere.
Back to top
View user's profile Send private message
scarr
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jun 2002
Posts: 88
Location: Lebanon, TN

PostPosted: Tue Oct 26, 2004 3:13 pm    Post subject: Reply with quote

I installed it about a month ago.

Check the HOW TO, it helped me setup MySQL as well as the Zap2It account for the guide.
_________________
Scott Carr * OpenOffice.org * Documentation Maintainer
http://documentation.openoffice.org
jabber: scarr@progbits.com
Back to top
View user's profile Send private message
Quantumstate
Apprentice
Apprentice


Joined: 26 May 2004
Posts: 270
Location: Dallas

PostPosted: Tue Oct 26, 2004 3:44 pm    Post subject: Reply with quote

The Myth HowTo is the one I'm using. And numerous things in it are just wrong. This is why most ppl have so much trouble with Myth.

Do you mean an informal HowTo in these forums?
Back to top
View user's profile Send private message
scarr
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jun 2002
Posts: 88
Location: Lebanon, TN

PostPosted: Tue Oct 26, 2004 4:06 pm    Post subject: Reply with quote

I am talking about the How To on Gentoo-Wiki.

It steps you through everything. There is some hardware specific stuff you need to ignore though.

That is where the mysql line came from that I sent earlier.
_________________
Scott Carr * OpenOffice.org * Documentation Maintainer
http://documentation.openoffice.org
jabber: scarr@progbits.com
Back to top
View user's profile Send private message
QuaffAPint
Tux's lil' helper
Tux's lil' helper


Joined: 29 Jan 2003
Posts: 82
Location: Downingtown, PA

PostPosted: Tue Oct 26, 2004 5:44 pm    Post subject: Reply with quote

I personally used this nice set of instructions that worked well for my setup.

Thanks again to Alfred for writing it up... :)
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