[mythtv-users] My MySql hell :-)

R. G. Newbury newbury at mandamus.org
Wed Mar 14 22:01:03 UTC 2007


Damian Surr wrote:
> I've checked every mysql.txt file on the system and they all have 
> 'mythtv' as the password.
> 
> I think I (or something) has screwed up the master mysql password and 
> that's why I can't get in to it. I've followed tutorials to reset the 
> password, but that hasn't worked. That's why I resorted to uninstalling 
> mysql-server and putting it back, but the problem persists!
> 
> Damian
> 
> Jean-Marc Melchior wrote:
>> the problem is, that Mythtv creates a text file with a random  
>> password mysql besides the password you setup in mythtv-setup, I  
>> don't remember exactly where it is located but its name is mysql.txt,  
>> i think it is /etc/mythtv/mysql.txt if you edit that file and change  
>> the password to your actual Mysql password then it should work...
>> the edgy installation sets the password to mythtv, so usually you  
>> just change user and password to mythtv, do the same mythtv-setup and  
>> it should work
>>
>> JMM

I think you are mistaking 2 different users and passwords. On Fedora, 
mysql installs and sets up an 'admin; (root) user. The admin user's 
password is left blank. This is of course, the antithesis of 'secure' as 
any user who is granted execution rights to the mysql client can enter 
'mysql -u root -p' and hit return twice to get into a mysql console.

When mythtv is set up (for example from SVN) the mc.sql script creates a 
mysql user called 'mythtv' with password 'mythtv'. For convenience, the 
system user is also 'mythtv'. (That is what Jarod's guide suggests and 
uses as an example).

 From comments here, it appears that Ubuntu does things sufficiently 
differently as to cause confusion. Firstly, you really have no 'root' 
user: you cannot login as root. (There are ways around that BTW). 
Secondly, it appears that Ubuntu creates a random password for the admin 
user...and sticks it somewhere...THAT may well be what has caught you.

IF you can find that root password, you can look at mysql's own database 
to see what users,hostnames and passwords exist. It should look like this:

# mysql -u root -p  mysql <Enter>
   Enter Password: <Enter>
mysql> use mysql;
Database changed
mysql> select host,user,password from user;
+-------------------+--------+------------------------------+
| host              | user   | password                     |
+-------------------+--------+------------------------------+
| localhost         | root   | hashed-random-password-here  |
| yourmachinename   | root   |                              |
| localhost         | mythtv | 0476fc026afffe24             |
+-------------------+--------+------------------------------+
3 rows in set (0.02 sec)

You proably have a password entry beside 'root' and you may not have an 
entry for 'yourmachinename', since the default setup is for 'localhost'. 
(And yes, the table 'user' has a field 'user'.)

If you cannot find that random password file, try deleting the 
/var/lib/mysql folder, BEFORE uninstalling and re-installing mysql. I 
doubt highly that the uninstall will delete existing databases. And it 
is the mysql database which contains and holds that random password. 
(Although it may not be at /var/lib/mysql...although I believe that 
under LSB it should be..)

and when you find out where Ubuntu puts that random password text file, 
please report it here and make an entry in the wiki so others can find 
the answer.

Geoff

















-- 
              R. Geoffrey Newbury			
            Barrister and Solicitor
       Suite 106, 150 Lakeshore Road West
          Mississauga, Ontario, L5H 3R2

         o905-271-9600 f905-271-1638
           newbury at mandamus.org

        Helping with the HTTP issue
<a href="http://www.w3.org/Protocols/">HTTP</a>


More information about the mythtv-users mailing list