KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

MySql custom port #3163

Open plavivranac opened this topic on on Oct 3, 2023 - 1 comments

plavivranac commented on Oct 3, 2023
return array(
            "dataSources"=>array(
                "reports"=>array(
                    "connectionString"=>"mysql:host=localhost;port=3308;dbname=my_db",
                    "username"=>"root",
                    "password"=>"xyz",
                    "charset"=>"utf8",
                    'class' => "\koolreport\datasources\MySQLDataSource" 
                  
                ),
            )
        ); 

I get error: Warning: mysqli::__construct(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in C:\wamp64_new\www\kooltest\koolreport\core\src\datasources\MySQLDataSource.php on line 105

Sebastian Morales commented on Oct 4, 2023

Pls try the following setting if you want to use the default PdoDataSource:

        return array(
            "dataSources"=>array(
                "reports"=>array(
                    "connectionString"=>"mysql:host=localhost;port=3308;dbname=my_db",
                    "username"=>"root",
                    "password"=>"xyz",
                    "charset"=>"utf8",                  
                ),
            ),
        );  

or the following one with MySQLDataSource:

        return array(
            "dataSources"=>array(
                "reports"=>array(
                    "host"=>"localhost:3308",
                    "dbname" => "my_db",
                    "username"=>"root",
                    "password"=>"xyz",
                    "charset"=>"utf8",
                    "class" => "\koolreport\datasources\MySQLDataSource",
                ),
            ),
        );  

If there's any error message pls let us know. Rgds,

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None