Next Previous Contents

6. MySQL.

6.1 Mandrake 9.0

If this is the system maintaining the database, make sure that mysql is running and started at boot. Click on Mandrake Control Center->System->Services, find mysql and click the "On Boot" button and the "Start" button if the mysql status shows that it isn't running yet.

NOTE: There have been reports that mysql isn't starting at boot.

$ su
# chkconfig --level 35 mysql on
# /etc/rc.d/init.d/mysql start
# exit

6.2 Red Hat Linux 8.0

If this is the system maintaining the database, make sure that mysql is running and started at boot. Click on Redhat menu>Server Settings>Services and enter the root password when asked. Check "mysqld" and then click Start. Click Save, then close the window.

6.3 Gentoo.

After installing mysql you need to initialise the database by running mysql_install_db as root.

6.4 Setting up the initial database.

This step is only required on the system maintaining the database, which may or may not be one of your MythTV boxes. If the database is on a non-MythTV machine, then copy the database/mc.sql file to it.

To setup the initial mysql databases:

$ cd database

Mandrake 9.0

$ mysql -u root < mc.sql

Debian 3.0

$ mysql < mc.sql

Red Hat Linux 8.0

$ su
# mysql < mc.sql

Gentoo

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

Modifying access to the MySQL database for multiple systems

If you're going to have multiple systems accessing a master database, you must grant access to the database from remote systems. By default, the mc.sql script is only granting access to the localhost.

To allow other hosts access to your master database, you can either set it up for no security at all, or with more granularity. Note that the "%" is the wildcard character in MySQL.

NOTE: The "no security" option is very dangerous unless you're in a controlled environment.

This example has no security at all, and allows access from any host.

$ mysql -u root mythconverg
mysql> grant all on mythconverg.* to mythtv@"%" identified by "mythtv";

For a more secure setup, you can restrict which machines or subnets have access. If you have a complete DNS system operational, you could do the following:

$ mysql -u root mythconverg
mysql> grant all on mythconverg.* to mythtv@"%.mydomain.com" identified by "mythtv";

Finally, if you just want to restrict by IP subnet:

$ mysql -u root mythconverg
mysql> grant all on mythconverg.* to mythtv@"192.168.1.%" identified by "mythtv";


Next Previous Contents