![]() |
Problem
Trying to create some migrations as I am learning CI and keep getting the following error: --------- Running all new migrations... [CodeIgniter\Database\Exceptions\DatabaseException] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ) DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci' at line 9 at SYSTEMPATH/Database/BaseConnection.php:646 ------------------ I have installed CI4 on a PopOS linux machine mysql version: 8.0.34-0ubuntu0.22.04.1 PHP version: 8.1.2-1ubuntu2.14 I am a Codeigniter newbie and although I have coded for years in the past and I have been a DBA in the past my mysql is only fine. Background - Learning how to do migrations - Have setup the DB connection in App/config/Database.php as follows: public array $default = [ 'DSN' => '', 'hostname' => 'localhost', 'username' => 'xxxxx', 'password' => 'xxxxx', 'database' => 'ci4blog_db', 'DBDriver' => 'MySQLi', 'DBPrefix' => '', 'pConnect' => false, 'DBDebug' => true, 'charset' => 'utf8mb4', 'DBCollat' => 'utf8mb4_0900_ai_ci', 'swapPre' => '', 'encrypt' => false, 'compress' => false, 'strictOn' => false, 'failover' => [], 'port' => 3306, 'numberNative' => false, ]; I have checked that the Character set in the DB are correct by doing the following: SELECT @@character_set_database, @@collation_database -------------- +--------------------------+----------------------+ | @@character_set_database | @@collation_database | +--------------------------+----------------------+ | utf8mb4 | utf8mb4_0900_ai_ci | +--------------------------+----------------------+ 1 row in set (0.00 sec) From what I can see I have the config matching the DB but yet, I still get the error above I have tried different Character set and collation combinations, and I always get the same error I could avoid using migrations by writing all my sql myself but feel I would like to understand the power of the migrations before doing that. Any ideas welcome. Thanks you |
Messages In This Thread |
ERROR: DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci' at line 9 - by ab-ci-2023 - 10-03-2023, 03:54 PM
RE: ERROR: DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci' at line 9 - by kenjis - 10-03-2023, 04:45 PM
RE: ERROR: DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci' at line 9 - by ab-ci-2023 - 10-07-2023, 04:43 AM
RE: ERROR: DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci' at line 9 - by InsiteFX - 10-03-2023, 08:59 PM
RE: ERROR: DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci' at line 9 - by wdeda - 10-04-2023, 06:15 AM
|