SetupTV configure-db/connection test fails if MP user have only rights to the MP database (1 Viewer)

Wiedmann

Portal Pro
June 22, 2007
107
28
Home Country
Germany Germany
MediaPortal Version: 1.6.0

Description
I have my own MySQL server and the MP db user have only rights to it's own database (and global usage).
Code:
mysql> show grants for `mptvdb`@`%`;
+-------------------------------------------------------------------------------
------------------------+
| Grants for mptvdb@%
                        |
+-------------------------------------------------------------------------------
------------------------+
| GRANT USAGE ON *.* TO 'mptvdb'@'%' IDENTIFIED BY PASSWORD 'hidden' |
| GRANT ALL PRIVILEGES ON `mptvdb`.* TO 'mptvdb'@'%' WITH GRANT OPTION
                        |
+-------------------------------------------------------------------------------
------------------------+
2 rows in set (0.00 sec)


In this situation the connection test fails, because you are not only try to connect to the server, you also want use the database `mysql` (a database a client must not do anything with...).

Just look at "TvEngine3\TVLibrary\SetupTv\SetupDatabaseForm.cs" and "Tools\MPTvClient\SetupDatabaseForm.cs".

You have (line ~154):
Code:
        case ProviderType.MySql:
          if (database == "") database = "mysql";
          return String.Format("Server={0};Database={3};User ID={1};Password={2};charset=utf8;Connection Timeout={4};",
                               server, userid, password, database, timeout);
Of course, for a connection test you don't need (and switch) to a database. You should remove the line:
Code:
if (database == "") database = "mysql";

BTW: Don't know how this works with MSSQL)

Steps to Reproduce:
see Description
 

Users who are viewing this thread

Top Bottom