Bug Description
Impossible to perform migrations through spark (experienced in versions 4.0.2 to 4.0.4)
Although DB credentials are set in .env and/orin app/Config/Database.php and successful query results obtained through Controller classes,
php spark migrate causes CodeIgniter\Database\Exceptions\DatabaseException
Exact command line output:
CodeIgniter CLI Tool - Version 4.0.4 - Server-Time: 2020-07-19 05:22:57am
Running all new migrations...
An uncaught Exception was encountered
Type: CodeIgniter\Database\Exceptions\DatabaseException
Message: Unable to connect to the database.
Filename: /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php
Line Number: 425
Backtrace:
-646 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php::initialize
-1548 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php::query
-1591 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php::listTables
-945 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/MigrationRunner.php::tableExists
-193 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/MigrationRunner.php::ensureTable
-128 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Commands/Database/Migrate.php::latest
-100 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/Commands.php::run
-107 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/CommandRunner.php::run
-85 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/CommandRunner.php::index
-914 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CodeIgniter.php::_remap
-404 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CodeIgniter.php::runController
-312 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CodeIgniter.php::handleRequest
-86 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/Console.php::run
-57 - /Applications/MAMP/ci4projs/deneme/spark::run
CodeIgniter 4 version
Last gotten in v4.0.4 release
Affected module(s)
spark
Expected behavior
All migrations performed successfully (without exceptions).
Steps to reproduce
cp env .env)database.default.DBDriver = MySQLi)cd denemephp spark migrate:create AddBlogphp spark migrateCodeIgniter CLI Tool - Version 4.0.4 - Server-Time: 2020-07-19 05:42:10am
Running all new migrations...
An uncaught Exception was encountered
Type: CodeIgniter\Database\Exceptions\DatabaseException
Message: Unable to connect to the database.
Filename: /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php
Line Number: 425
Backtrace:
-646 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php::initialize
-1548 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php::query
-1591 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php::listTables
-945 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/MigrationRunner.php::tableExists
-193 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/MigrationRunner.php::ensureTable
-128 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Commands/Database/Migrate.php::latest
-100 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/Commands.php::run
-107 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/CommandRunner.php::run
-85 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/CommandRunner.php::index
-914 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CodeIgniter.php::_remap
-404 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CodeIgniter.php::runController
-312 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CodeIgniter.php::handleRequest
-86 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/Console.php::run
-57 - /Applications/MAMP/ci4projs/deneme/spark::run
Context
May I know the database driver you used? I tried this using SQLite3 with :memory: as DB for the default connection and encountered no problems.
CodeIgniter CLI Tool - Version 4.0.4 - Server-Time: 2020-07-19 06:35:49am
Running all new migrations...
Running: (App) 2020-07-19-113439_App\Database\Migrations\AddBlog
Done
I have exactly the same issue, tried firstly with custom migration, then switch back to tutorial migrations. When you try to use MySQLi as driver, this happens. I have also checked in the debugger for the database credentials, and everything looks fine
CodeIgniter CLI Tool - Version 4.0.4 - Server-Time: 2020-07-19 09:57:05am
An uncaught Exception was encountered
Type: CodeIgniter\Database\Exceptions\DatabaseException
Message: Unable to connect to the database.
Filename: /var/www/html/system/Database/BaseConnection.php
Line Number: 425
Backtrace:
-109 - /var/www/html/system/Database/Database.php::initialize
-148 - /var/www/html/system/Database/Config.php::loadForge
-15 - /var/www/html/app/Commands/SetupApp.php::forge
-100 - /var/www/html/system/CLI/Commands.php::run
-107 - /var/www/html/system/CLI/CommandRunner.php::run
-85 - /var/www/html/system/CLI/CommandRunner.php::index
-914 - /var/www/html/system/CodeIgniter.php::_remap
-404 - /var/www/html/system/CodeIgniter.php::runController
-312 - /var/www/html/system/CodeIgniter.php::handleRequest
-86 - /var/www/html/system/CLI/Console.php::run
-57 - /var/www/html/spark::run
`
Can you tell me the details of your DB config? Just exclude sensitive information like the password.
#--------------------------------------------------------------------
# ENVIRONMENT
#--------------------------------------------------------------------
CI_ENVIRONMENT = development
#--------------------------------------------------------------------
# DATABASE
#--------------------------------------------------------------------
database.default.hostname = localhost
database.default.database = deneme
database.default.username = arclab
database.default.password = Passw0rd
database.default.DBDriver = MySQLi
Everything else is as same as what shipped with the default env file.
May I know the database driver you used? I tried this using
SQLite3with:memory:as DB for thedefaultconnection and encountered no problems.CodeIgniter CLI Tool - Version 4.0.4 - Server-Time: 2020-07-19 06:35:49am Running all new migrations... Running: (App) 2020-07-19-113439_App\Database\Migrations\AddBlog Done
Using database.default.DBDriver = MySQLi
@gosocial2 have you tried checking if the database deneme exists in the MySQL server? And/or the username/password is registered?
I was able to replicate this problem but only when there was no database. You have to create a database manually before running migrations.
CodeIgniter will create a database only for the SQLite3 driver.
Yes, this is reproducible if either the database does not exist or the username/password is not registered.
I want to add something to this. I've just retested my case.
If I try to connect to the database using a standard model, the connection works. The database exists, and everything works.
When I try to run the migration itself he doesn't work, I have this error again.
CodeIgniter CLI Tool - Version 4.0.4 - Server-Time: 2020-07-19 09:57:05am
An uncaught Exception was encountered
Type: CodeIgniter\Database\Exceptions\DatabaseException
Message: Unable to connect to the database.
Filename: /var/www/html/system/Database/BaseConnection.php
Line Number: 425
Via controller/request is working but is not the same when I try to use commands via spark, no.
DB connection works through code in Controllers running in the web application so database is accessible alright. It just doesn't work with spark. Spark is not seeing the DB config in .env or in app\Config\Database.php .
I also tested with ci-news app - same result. Did you try to reproduce through the steps in the issue description? (e.g. using composer to create a project from scratch)
@gosocial2 Yes, I followed steps from your description.
Okay... it seems like a bug but I can't reproduce it for now. And I have no idea what can cause it. I will try to deal with this tomorrow maybe.
If you think that there is something "specific" in your working environment, please share.
@paulbalandan @michalsn The problem is not the inexistence of the DB or models or controllers not connecting to the DB, guys. The issue, as already stated in the title, is php spark migrate is not working for ignoring the DB credentials set for MYSQLi driver.
@michalsn it happens when you create a new project with composer and add any migration. so no specific env settings.
Also no pressure intended. No need to hurry - just something to be aware of for the near future.
Have you tried changing localhost to 127.0.0.1?
Seems like the problem is MySQLi connection can't obtain a connection ID even after substituting the failover sets. So we need to know the error logged by MySQLi. @gosocial2 , please edit public $threshold in your Config\Logger to a value of 4 so that we can record also the runtime errors. Then run again the migrations. After that go to your writable/logs and get the log file for this day. It will show you the MySQL error.
Have you tried changing
localhostto127.0.0.1?
@paulbalandan I followed your instruction:
log with $threshold = 4 below (actually no different than level 3:
ERROR - 2020-07-20 01:57:08 --> Error connecting to the database: No such file or directory
CRITICAL - 2020-07-20 01:57:08 --> Unable to connect to the database.
#0 /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php(646): CodeIgniter\Database\BaseConnection->initialize()
#1 /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php(1548): CodeIgniter\Database\BaseConnection->query('SHOW TABLES FRO...')
#2 /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php(1591): CodeIgniter\Database\BaseConnection->listTables()
#3 /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/MigrationRunner.php(945): CodeIgniter\Database\BaseConnection->tableExists('migrations')
#4 /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/MigrationRunner.php(193): CodeIgniter\Database\MigrationRunner->ensureTable()
#5 /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Commands/Database/Migrate.php(128): CodeIgniter\Database\MigrationRunner->latest(NULL)
#6 /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/Commands.php(100): CodeIgniter\Commands\Database\Migrate->run(Array)
#7 /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/CommandRunner.php(107): CodeIgniter\CLI\Commands->run('migrate', Array)
#8 /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/CommandRunner.php(85): CodeIgniter\CLI\CommandRunner->index(Array)
#9 /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CodeIgniter.php(914): CodeIgniter\CLI\CommandRunner->_remap('index', 'migrate')
#10 /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CodeIgniter.php(404): CodeIgniter\CodeIgniter->runController(Object(CodeIgniter\CLI\CommandRunner))
#11 /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CodeIgniter.php(312): CodeIgniter\CodeIgniter->handleRequest(NULL, Object(Config\Cache), false)
#12 /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/Console.php(86): CodeIgniter\CodeIgniter->run()
#13 /Applications/MAMP/ci4projs/deneme/spark(57): CodeIgniter\CLI\Console->run()
#14 {main}
@lonnieezell
Have you tried changing
localhostto127.0.0.1?
Following your suggestion, issue is resolved. Changing localhost to 127.0.0.1 in .env (and not app/Config/Database.php) works for spark.
Thanks to all who spared time and effort in looking into this.
In my case, it creates the tables in the database. So, it connects and executes the table create functions. Yet, it gives the same error
ACTION:
php spark migrate -all
REACTION:
CodeIgniter CLI Tool - Version 4.0.4 - Server-Time: 2020-08-03 16:05:28pm
Running all new migrations...
An uncaught Exception was encountered
Type: CodeIgniter\Database\Exceptions\DatabaseException
Message: Unable to connect to the database.
Filename: /var/www/html/MyAPP/vendor/codeigniter4/framework/system/Database/BaseConnection.php
Line Number: 425
Backtrace:
-109 - /var/www/html/MyAPP/vendor/codeigniter4/framework/system/Database/Database.php::initialize
-148 - /var/www/html/MyAPP/vendor/codeigniter4/framework/system/Database/Config.php::loadForge
-78 - /var/www/html/MyAPP/vendor/codeigniter4/framework/system/Database/Migration.php::forge
-1026 - /var/www/html/MyAPP/vendor/codeigniter4/framework/system/Database/MigrationRunner.php::__construct
-223 - /var/www/html/MyAPP/vendor/codeigniter4/framework/system/Database/MigrationRunner.php::migrate
-128 - /var/www/html/MyAPP/vendor/codeigniter4/framework/system/Commands/Database/Migrate.php::latest
-100 - /var/www/html/MyAPP/vendor/codeigniter4/framework/system/CLI/Commands.php::run
-107 - /var/www/html/MyAPP/vendor/codeigniter4/framework/system/CLI/CommandRunner.php::run
-85 - /var/www/html/MyAPP/vendor/codeigniter4/framework/system/CLI/CommandRunner.php::index
-914 - /var/www/html/MyAPP/vendor/codeigniter4/framework/system/CodeIgniter.php::_remap
-404 - /var/www/html/MyAPP/vendor/codeigniter4/framework/system/CodeIgniter.php::runController
-312 - /var/www/html/MyAPP/vendor/codeigniter4/framework/system/CodeIgniter.php::handleRequest
-86 - /var/www/html/MyAPP/vendor/codeigniter4/framework/system/CLI/Console.php::run
-57 - /var/www/html/MyAPP/spark::run
Not only creating the tables; it also alters migration table
"1" "2017-11-20-223112" "Myth\Auth\Database\Migrations\CreateAuthTables" "default" "Myth\Auth" "1596488531" "1"
In my case, it creates the tables in the database. So, it connects and executes the table create functions. Yet, it gives the same error
I found the same! I got the same "Unable to connect to the database" message every time. I didn't think to check the database for tables as I assumed nothing would have changed if unable to connect.
Then I read the post by Ferhat Bingol and found the tables had been created! Thank you for spotting this and posting.
@lonnieezell
Have you tried changing
localhostto127.0.0.1?Following your suggestion, issue is resolved. Changing
localhostto127.0.0.1in .env (and not app/Config/Database.php) works for spark.Thanks to all who spared time and effort in looking into this.
I couldn't solve with this way, is there anybody still having this issue?
I just found a solution to migrate with command() function. But still, from cli it does not work.
echo command("migrate");
in controller.
The issue resurrected with PHP 7.4 with no matter whether you set database.default.hostname = '127.0.0.1' or = 127.0.0.1 or =localhost
Type: CodeIgniter\Database\Exceptions\DatabaseException
Message: Unable to connect to the database.
Filename: /Applications/MAMP/ci4projs/cmseoign/vendor/codeigniter4/framework/system/Database/BaseConnection.php
Line Number: 425
Backtrace:
-646 - /Applications/MAMP/ci4projs/cmseoign/vendor/codeigniter4/framework/system/Database/BaseConnection.php::initialize
-1548 - /Applications/MAMP/ci4projs/cmseoign/vendor/codeigniter4/framework/system/Database/BaseConnection.php::query
-1591 - /Applications/MAMP/ci4projs/cmseoign/vendor/codeigniter4/framework/system/Database/BaseConnection.php::listTables
-945 - /Applications/MAMP/ci4projs/cmseoign/vendor/codeigniter4/framework/system/Database/MigrationRunner.php::tableExists
-193 - /Applications/MAMP/ci4projs/cmseoign/vendor/codeigniter4/framework/system/Database/MigrationRunner.php::ensureTable
-128 - /Applications/MAMP/ci4projs/cmseoign/vendor/codeigniter4/framework/system/Commands/Database/Migrate.php::latest
-100 - /Applications/MAMP/ci4projs/cmseoign/vendor/codeigniter4/framework/system/CLI/Commands.php::run
-155 - /Applications/MAMP/ci4projs/cmseoign/vendor/codeigniter4/framework/system/CLI/BaseCommand.php::run
-68 - /Applications/MAMP/ci4projs/cmseoign/vendor/agungsugiarto/boilerplate/src/Commands/InstallCommand.php::call
-100 - /Applications/MAMP/ci4projs/cmseoign/vendor/codeigniter4/framework/system/CLI/Commands.php::run
-107 - /Applications/MAMP/ci4projs/cmseoign/vendor/codeigniter4/framework/system/CLI/CommandRunner.php::run
-85 - /Applications/MAMP/ci4projs/cmseoign/vendor/codeigniter4/framework/system/CLI/CommandRunner.php::index
-914 - /Applications/MAMP/ci4projs/cmseoign/vendor/codeigniter4/framework/system/CodeIgniter.php::_remap
-404 - /Applications/MAMP/ci4projs/cmseoign/vendor/codeigniter4/framework/system/CodeIgniter.php::runController
-312 - /Applications/MAMP/ci4projs/cmseoign/vendor/codeigniter4/framework/system/CodeIgniter.php::handleRequest
-86 - /Applications/MAMP/ci4projs/cmseoign/vendor/codeigniter4/framework/system/CLI/Console.php::run
-57 - /Applications/MAMP/ci4projs/cmseoign/spark::run
(using MySQL 5.7)
We have a test coverage in place for this, so I'm pretty confident that the code is working fine.
It's probably something with your local configuration. Please take a look at your log file located in writable/logs - you will find there a detailed database error message. I would guess that it's something related to the wrong socket path configuration in php.ini.
I've got the same issue trying to run the spark migrate commands, and have tried using hostname and ip address for mysql server in the db configurations in .env
I am using a basic xampp install with PHP 7.4.8 on Windows
An extract of my log is attached:
ci4-migrate-errors.txt
Please check if you're using the correct ini file in CLI php --ini. You may try checking the mysqli.default_socket value in php.ini.
Also, please check writable/logs/ for detailed info about the error.
Okay, first things first. To properly diagnose this recurring issue, we need to check the following:
4 to see the actual error message thrown by the db connection.caching_sha2_password) or using the older (mysql_native_password). Differences in the hashing for the MySQL server against the MySQL client can still lead to invalid connections.I change the php version and I forgot to add the php7.*-mysql extension. You can check it.
You may run your app in your server, but write commands from local terminal. Solution for that you can try to connect with ssh to your server. In this situation you may create a new migration file from terminal, but can't run migrations. Because you try to run it from your localhost and your application is connected to server's mysql, so it can't access there.
As this is most likely to be a user configuration error more than a framework error, I'm closing this.
For php 7.4


Works for MySqli

SQLite3 - in web wroks

in CLI not

last log
CRITICAL - 2020-10-28 13:03:55 --> Unable to connect to the database.
For php 7.3
[28-Oct-2020 18:20:20 UTC] PHP Fatal error: Uncaught Error: Call to undefined function CodeIgniter\locale_set_default() in C:\pwc\www\makisystem\CodeIgniter.php:184
Stack trace:
thrown in C:\pwc\www\makisystem\CodeIgniter.php on line 184
I change php cli for php7.4 and works

Bug Description
Impossible to perform migrations through spark (experienced in versions 4.0.2 to 4.0.4)Although DB credentials are set in .env and/orin app/Config/Database.php and successful query results obtained through Controller classes,
php spark migratecausesCodeIgniter\Database\Exceptions\DatabaseExceptionExact command line output:
CodeIgniter CLI Tool - Version 4.0.4 - Server-Time: 2020-07-19 05:22:57am Running all new migrations... An uncaught Exception was encountered Type: CodeIgniter\Database\Exceptions\DatabaseException Message: Unable to connect to the database. Filename: /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php Line Number: 425 Backtrace: -646 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php::initialize -1548 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php::query -1591 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php::listTables -945 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/MigrationRunner.php::tableExists -193 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/MigrationRunner.php::ensureTable -128 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Commands/Database/Migrate.php::latest -100 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/Commands.php::run -107 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/CommandRunner.php::run -85 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/CommandRunner.php::index -914 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CodeIgniter.php::_remap -404 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CodeIgniter.php::runController -312 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CodeIgniter.php::handleRequest -86 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/Console.php::run -57 - /Applications/MAMP/ci4projs/deneme/spark::runCodeIgniter 4 version
Last gotten in v4.0.4 releaseAffected module(s)
sparkExpected behavior
All migrations performed successfully (without exceptions).Steps to reproduce
- Open up a Terminal / command line window
- Change to the directory to the grand-parent level of your webserver's htdocs where htdocs will be substituted with the public directory of CI4
- composer create-project codeigniter4/appstarter deneme
- Open the project in your code editor and edit the .env file to set CI_ENVIRONMENT = development (duplicate it first from the file named 'env' if it doesn't exist - i.e.
cp env .env)- Perform one or both of steps 6 and 7:
- Enter DB credentials for MySQL in .env file (with
database.default.DBDriver = MySQLi)- Enter DB credentials in app/Config/Database.php
- Go back to the command line and run the following commands (in my example proj name is 'deneme':
9:cd denemephp spark migrate:create AddBlog- (Optional) Go back to your code editor and open the file whose name is resembles "2020_mm_dd_hhmmss_AddBlog.php" from app/Database/Migrations
- (Optional) Replace the contents of up() and down() methods with example from https://codeigniter.com/user_guide/dbmgmt/migration.html
- Go back to the command line and while still in the root directory of the CI4 project run
php spark migrate- Compare your Terminal output to the following output:
CodeIgniter CLI Tool - Version 4.0.4 - Server-Time: 2020-07-19 05:42:10am Running all new migrations... An uncaught Exception was encountered Type: CodeIgniter\Database\Exceptions\DatabaseException Message: Unable to connect to the database. Filename: /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php Line Number: 425 Backtrace: -646 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php::initialize -1548 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php::query -1591 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/BaseConnection.php::listTables -945 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/MigrationRunner.php::tableExists -193 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Database/MigrationRunner.php::ensureTable -128 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/Commands/Database/Migrate.php::latest -100 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/Commands.php::run -107 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/CommandRunner.php::run -85 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/CommandRunner.php::index -914 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CodeIgniter.php::_remap -404 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CodeIgniter.php::runController -312 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CodeIgniter.php::handleRequest -86 - /Applications/MAMP/ci4projs/deneme/vendor/codeigniter4/framework/system/CLI/Console.php::run -57 - /Applications/MAMP/ci4projs/deneme/spark::runContext
- OS: Experienced in macOS 10.3
- Web server: Apache 2.x (in MAMP 5.4)
- PHP version 7.3.7
- MySQL 5.7
Hello Guys,
Had similar issue and found that php' mysqli extension was disabled from ini config files.
Enabled it > Restarted Apache > executed spark commands > Works Fine!馃憤
Most helpful comment
Have you tried changing
localhostto127.0.0.1?