post by phamtungvnp on Jan 11, 2023

We can’t process the response of the server. This is all we know about it:

**Summary:** 500 - Internal Server Error
**Error:** error
**Response:**

In the LOG file in CODE IGINTER 4
Connect Error: SQLSTATE[28000] [1045] Access denied for user ****'@'****' (using password: NO)
in APPPATH/Libraries/GroceryCrudEnterprise/laminas/laminas-db/src/Adapter/Driver/Pdo/Connection.php on line 280..........

i followed Codeigniter 4 Installation (Codeigniter 4 Installation | Grocery CRUD - A PHP CRUD Generator Library)
Create functions asf:

private function _getDbData() {
        $db = (new \Config\Database())->default;
        return [
        'adapter' => [
        'driver' => 'Pdo_Mysql',
        'host'     => $db['localhost'],
        'database' => $db['********'],
        'username' => $db['*********'],
        'password' => $db['***********'],
        'charset' => 'utf8'
        ]
        ];
    }
    private function _getGroceryCrudEnterprise($bootstrap = true, $jquery = true) {
        $db = $this->_getDbData();
        $config = (new \Config\GroceryCrudEnterprise())->getDefaultConfig();
        
                $groceryCrud = new GroceryCrud($config, $db);
                return $groceryCrud;
    }

I used the free GroceryCrud for CI4 and it worked. However, when buying the Enterprise version, it not run, GroceryCrud possible to access the database. Is GroceryCrud unable to run with CI4?
How can i fix this?

post by cybernicois on Jan 18, 2023

private function _getDbData() {
        $db = (new \Config\Database())->default;
        return [
            'adapter' => [
                'driver' => 'Pdo_Mysql',
                'host'     => $db['hostname'],
                'database' => $db['database'],
                'username' => $db['username'],
                'password' => $db['password'],
                'charset' => 'utf8'
            ]
        ];
    }

don’t put the username or password as it’s already in the config>database.php or the .env file
And check the username and password…

1 / 2
Jan 2023