Welcome Guest, Not a member yet? Register   Sign In
Can't create new database with forge
#1

(This post was last modified: 05-05-2025, 09:02 PM by occitan.)

I have tried this: 
PHP Code:
$forge = \Config\Database::forge();
$forge->createDatabase('test_1002'); 


and this:

PHP Code:
$dbName 'test_1002';
$sql "CREATE DATABASE {$dbName}";
$query $this->db->query($sql); 


and I get: 

PHP Code:
CRITICAL 2025-05-06 03:35:45 --> [Caused bymysqli_sql_exceptionAccess denied for user 'development'@'%' to database 'test_1002' 


The server is Liquid Web Alma Linux, Maria DB, Plesk... the db user has full access to all functions and all databases. 
I can create a db over ssh but it doesn't show up to Plesk, because Plesk only tracks it's own databases. 
Does anyone know how to get past this, and create Plesk visible databases with CI4?
Reply
#2

Can you try using the terminal?

php spark db:create test_1002
Reply
#3

(This post was last modified: 05-06-2025, 11:47 AM by occitan.)

(05-06-2025, 11:13 AM)paulbalandan Wrote: Can you try using the terminal?

php spark db:create test_1002

See my original post: "I can create a db over ssh..."
Reply
#4

I do not mean using SSH. I meant using spark using the command line. But since you don't want that, let me try again differently.

Instead of using forge, try using `command('db:create test_1002');` in there.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB