We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19579
    • 51 Posts
    Hello all,

    I installed Janitor on a fully working Modx 2.2.0 system. The component seems to install correctly but when I access it I get the following error:

    Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'localhost;port=3351' (11004) in C:\domains\documentservicesvalley.com\wwwroot\assets\components\janitor\common\modx.php on line 22
    You are not authorized to view this page.

    I have to use localhost;port=3351 to access the database but somehow Janitor can not work with that. When I check the file in the error (assets\components\janitor\common\modx.php) I don 't see any mention of the localhost so I guess it's loading the value it dynamically.

    Anyone an idea how to fix this?

    This question has been answered by shamblett. See the first response.

    • discuss.answer
      • 26903
      • 1,336 Posts
      It uses the values from your config file, being :-
      mysql_connect($database_server, $database_user, $database_password);

      so your database server string must be localhost;port=3351, according to mysql this should be 'hostname:port' not 'hostname;port=xxxx' as you seem to have.

      It looks as though this is coming from the config file, for now hardwire the $database_server to 'localhost:3351' and see if it works.

      Note, this may break othee parts of Janitor also.
        Use MODx, or the cat gets it!
        • 19579
        • 51 Posts
        @shamblett, that did the trick!

        For others with a similar problem, I added this to the modx.php file on line 19:

        $database_server = "localhost:3351";