The solutions given are for self-hosted Ghost developers who are using the supported install method with
ghost-cli. If you’re having problems with an unsupported custom install, check out the forum.
Error ECONNREFUSED
If you’re seeing an ECONNREFUSED error, which refers to port 3306, Ghost wasn’t able to connect to your MySQL server and you need to check if your server is running via the command line.
To fix this issue:
- Ensure the server is running with
sudo service mysql start - Test that the server is now running by typing
mysqlin the command line and checking the response - If this error occurred after using
ghost install, once resolved, re-run the setup phase usingghost setup
Error ER_BAD_FIELD_ERROR
This may be caused by ANSI_QUOTES sql mode or by combination modes such as ANSI that include ANSI_QUOTES. To check your sql mode, run SELECT @@sql_mode in mysql.
To fix this issue:
- Find and open your
my.cnffile (see below) - Remove
ANSI_QUOTESorANSIfrom thesql_modeline
Error ER_FK_COLUMN_CANNOT_CHANGE
This may be caused by missing the STRICT_TRANS_TABLES sql mode.
To fix this issue:
- Find and open your
my.cnffile (see below) - Add
STRICT_TRANS_TABLESto thesql_modeline
Error ER_TOO_BIG_ROWSIZE
The row_format of a table determines how it is stored, and this introduces limits on the size of the data. Older versions of MySQL and MariaDB used a different default row_format of COMPACT or REDUNDANT, which have stricter row size limits. The default on the latest version is DYNAMIC, which is what we support.
In MariaDB 10.1 and before, and in MySQL 5.6 and before, the COMPACT row format was the default row format. - https://mariadb.com/kb/en/troubleshooting-row-size-too-large-errors-with-innodb/
- Run
show table status;whilst attached to the database in MySQL - If
Row_formatsaysCOMPACTorREDUNDANT, this table needs updating toDYNAMIC.
DYNAMIC format:
- Ensure you have a recent backup of your database
- Update MySQL to the latest supported version (so the default is
DYNAMICmoving forwards) - For each table, run
ALTER TABLE <table> ROW_FORMAT=DYNAMIC; show table status;should report all tables areDYNAMICand the problem should be solved
Error ER_CANT_CREATE_TABLE with “Foreign key constraint is incorrectly formed” or ER_FK_INCOMPATIBLE_COLUMNS
MySQL is unable to create tables with foreign keys referencing tables using a different collation. This usually occurs after upgrading to MySQL 8 from an earlier version:
The default collation for utf8mb4 differs between MySQL 5.7 and 8.0 (
utf8mb4_general_ci for 5.7, utf8mb4_0900_ai_ci for 8.0). - https://dev.mysql.com/doc/refman/8.0/en/charset-connection.htmlshow variables like '%collation_connection%';.
Finding your my.cnf file
- Run
mysql --helpand look for the line “Default options are read from the following files in the given order:” - Below that line will be a list of locations to check
- You can also try using find:
sudo find / -name my.cnfalthough the file can be called eithermy.cnfor.my.cnf - If you can’t find a my.cnf file, create one at the first location in the list provided by
mysql --help. - The default sql_mode line in MySQL 8 looks like:
sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

