Questions tagged [mysql]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
37 views

Multiple errors attempting to migrate MariaDB Craft CMS 3 database to PostgreSQL via pgloader. Alternatives?

I've been at this for a couple days now and it's not looking good. I'm trying to migrate a Craft CMS 3.9.5 (latest) database running on MariaDB to Postgres using pgloader 3.6.10. I've attempted this ...
CBallenar's user avatar
  • 111
6 votes
2 answers
184 views

Craft loses contact with database, and stops daemon

Somehow the queue/listen occasionally loses access to the database: FATAL Exited too quickly . Database Connection Error: Craft CMS can’t connect to the database. As the connection is lost, it ...
Eddie's user avatar
  • 61
0 votes
0 answers
72 views

Duplicate entry '2022' for key 'categorygroups_sites.PRIMARY'

I'm trying to get a live site running locally (using DDEV) and having trouble importing the database. The database is an export from the live site (which is running and has been for a short time). ...
Jaytrix's user avatar
  • 187
0 votes
0 answers
99 views

SQLSTATE[HY000]: General error: 5 Out of memory (Needed 418490224 bytes)

I'm building a webtoon with CraftCMS 4 but facing this issue: SQLSTATE[HY000]: General error: 5 Out of memory (Needed 418490224 bytes) Screenshot: https://i.stack.imgur.com/oMKud.png All entries are a ...
Alex's user avatar
  • 1
1 vote
1 answer
79 views

Azure returning incorrect MySQL version. MySQL 5.7.8 or higher is required to run Craft CMS

I have upgraded one of our sites to Craft CMS 4 and moved it to a staging site on Azure. The front-end works but the control panel gives the MySQL 5.7.8 or higher is required to run Craft CMS error. ...
Watsonian's user avatar
2 votes
1 answer
192 views

Migrating a Craft 4 instance from MySQL to PostgreSQL

I've managed to convert a fairly basic Craft 4 MySQL db to PostgreSQL using the pgloader tool, which came with it's own auth related issues when running PSQL v14+ instance - see https://github.com/...
Rich D.'s user avatar
  • 45
1 vote
1 answer
226 views

MySQL 5.7.8 or higher is required to run Craft CMS Error

I'm extremely new to Craft CMS and having to ensure it can be ran from a Azure Virtual Machine. I have added, Apache, PHP and MySQL and the website does run on the server. However the issue occurs ...
Richard Griffiths's user avatar
2 votes
2 answers
154 views

Nitro: how risky is it to dev using MariaDB and then go live with MySQL?

Nitro does not support MySQL for Apple Silicon, but you can use MariaDB interchangeably. I'm using an Apple Silicon computer, and my server run with MySQL only. However, as read in the Craft Database ...
Romain P.'s user avatar
  • 1,808
1 vote
1 answer
214 views

How to make Craft CMS 4 works with the older version of MySQL of MAMP Pro?

I'm used to working with MAMP instead of Nitro and would like to keep this setup as I find it easy to manage my other older setups. As MAMP (Pro) support is until MySQL 5.7.34 and as Craft CMS 4 ...
Romain P.'s user avatar
  • 1,808
1 vote
2 answers
349 views

MySQL server has gone away / max_allowed_packet

After adding a second block type to an existing matrix field, we started receiving a "General error: 2006 MySQL server has gone away" error when additional content was saved to the new block ...
plaintxt's user avatar
  • 488
1 vote
1 answer
79 views

Getting 503 error when setting up a site with CraftCMS nitro

I am experimenting with Nitro and getting the 503 db error when trying to connect db. I am able to connect to my GUI (Sequel Ace) but not get the browser connecting. My db.php is as follows: return [ ...
peco60052's user avatar
1 vote
1 answer
241 views

Unable to setup Craft on a DigitalOcean managed DB

I just cloned an existing droplet with a working instance of Craft, I created a MySQL8 managed DB but whenever I run php ./craft setup I get this error: Caused by: Exception 'yii\db\Exception' with ...
tfantina's user avatar
  • 125
1 vote
0 answers
137 views

Order element query by number of related categories

I'm building an entry template that displays related entries to the current entry. To be related, an entry needs to be the same type as the current entry and share at least one category in one of two ...
MoritzLost's user avatar
  • 11.1k
1 vote
1 answer
78 views

Craft Script: Environment variable GLOBAL_DB_DRIVER was neither 'mysql' nor 'pgsql'

I keep getting the error Environment variable GLOBAL_DB_DRIVER was neither 'mysql' nor 'pgsql'. Aborting. when trying to pull the database from the production server to staging using Craft Script. I ...
Lee's user avatar
  • 139
1 vote
1 answer
319 views

How do you change from MySQL 5.7 to MySQL 8 in Nitro on MacOS

I usually use Nitro and docker to run Craft. Nitro created a Docker container with MySQL 5.7. How can I change that version to MySQL 8?
EdisonJS's user avatar
0 votes
0 answers
94 views

SQL Queries Performing Full Table Scan

Per the title, our application's db query has from time to time pegged our CPU to the max and taken down the site. Our site has gotten quite large in terms of content and trying to figure out how best ...
zhua89's user avatar
  • 31
0 votes
0 answers
162 views

Certain Queries Pegging CPU and Causing Production Site to go Down

I read these two posts MySQL CPU pegged on specific query Poor performance on midsized site / Queries without index? and and am in a similar situation although for us it actually breaks our site and ...
zhua89's user avatar
  • 31
1 vote
1 answer
189 views

MySQL error when sync database using Craft Script from Craft Nitro

I'm trying to sync the database from staging to local (Craft Nitro) using the craft-script as per the article. Here is the error message, Usage: mysqldump [OPTIONS] database [tables] OR mysqldump [...
Lee's user avatar
  • 139
0 votes
0 answers
58 views

SyncDB with Nitro Fail to sync database from local to staging

I'm trying to sync the database for my local Craft Nitro to the staging environment using SyncDB. Here is the error, [2021-06-04T15:49:51.623536+08:00] sync.NOTICE: Starting database sync [] [] [2021-...
Lee's user avatar
  • 139
1 vote
2 answers
368 views

Unable to backup the database or apply migrations

I'm running CraftCMS via 3 Docker containers in 1 Docker network: Container 1 - MySQL Container 2 - Nginx Container 3 - PHP:7.4-fpm When I run php craft update craft from container 3 and choose to ...
studio-pj's user avatar
  • 111
1 vote
0 answers
76 views

Building a yii query for Connect plugin

I'm using the Connect plugin by Andrew Welch to get some data from an external database. Somewhere in the data, I need data from another related table. The way I'm doing this now is like this: {% set ...
Bart Rylant's user avatar
2 votes
1 answer
45 views

Deleted rows from elements_sites hunting stray slugs now I can't login

Working on a migration up/down testing I went through and deleted TOO much from the element_sites table to remove unwanted slugs, not understanding really what's in there. Now I understand many ...
Robert's user avatar
  • 53
1 vote
0 answers
271 views

Craft warning: Tried to release a savepoint, but it does not exist

I'm working on a plug-in for Craft 3. For this plug-in is a migration is needed. When this migration runs and adds the entries, fields, and groups then the following warning occurs in the logs. [...
randomGuy's user avatar
1 vote
1 answer
169 views

Database driver & version after server upgrade

The server I'm running Craft installations on just got an upgrade to Ubuntu 20 with MariaDB 10.5 Before MySql 5.7 was used. When I look at the System Report in the Craft CP, it says: Database driver &...
obs's user avatar
  • 499
1 vote
1 answer
328 views

Craft Setup 3.6.5.1 with MYSQL with SSL version 5.7.29

I'm trying to install Craft version 3.6.5.1 with MYSQL version 5.7.29 from Azure. While setup it fails with the following error Testing database credentials ... failed: SQLSTATE[HY000] [9002] SSL ...
Deepak Kale's user avatar
1 vote
0 answers
99 views

Very slow `INSERT` transactions on the resourcepaths table

After a recent update (Craft 3.4.x to 3.5.x) I'm seeing some suspiciously slow response times in relation to INSERT actions on the resourcepaths table. Some in the upwards of a half second for a ...
Aaron Bushnell's user avatar
1 vote
0 answers
44 views

Craft cannot backup - Azure

When attempting to backup with Craft, the system returns the following error: The shell command "mysqldump --defaults-extra-file="D:\local\Temp\my.cnf" --add-drop-table --comments --...
M Smith's user avatar
  • 150
5 votes
1 answer
724 views

Running Craft CMS 2 on MySQL 8.0+ (Any major considerations?)

Yes, that's not a typo. This is for a Craft 2 site (long story). Because MySQL 5.6 is EOL in a few weeks, I am validating how feasible it can be to run under MySQL 8.0, there's not really any option ...
James White's user avatar
  • 1,151
1 vote
1 answer
63 views

MySQL 5.6 backup to MySQL 5.7... what to do

I just changed my db server, and I managed to import a db dump to the new system. What troubles me is that, once done, I noticed I have now MySQL 5.7.32, while the previous database server was 5.6.48. ...
Masiorama's user avatar
  • 205
1 vote
2 answers
232 views

Using MySQL With just InnoDB storage engine

What are the implications if I create all the Craft database tables on the InnoDB storage engine? Will there be any performance problem?
Deepak Kale's user avatar
2 votes
1 answer
537 views

Craft CMS Entries Disappearing

I've setup a Craft 3 site for a client and we are seeing the strangest thing where pages are just disappearing. Best we can tell no-one has deleted the entry, but we get a 404 on the front-end and it ...
Austin's user avatar
  • 151
0 votes
0 answers
41 views

Saving to db with devMode true works, but not when false

// Upload and save as temp file $request = Craft::$app->request; $file = UploadedFile::getInstanceByName('file'); $tempPath = $file->saveAsTempFile(); // Create as permanent asset $folder = ...
Stian Karlsen's user avatar
5 votes
1 answer
901 views

Is there a way to convert a Craft MySQL database to PostgreSQL?

I have an existing Craft installation using MySQL and I've only recently realized the error of my ways and would like to convert the database to PostgreSQL. Is this possible?
Brad Bell's user avatar
  • 67.4k
1 vote
1 answer
251 views

Download database in gzip

With using the CraftCMS builtin database export feature, is it possible to specify the export config to have the file in .gzip instead of just .zip? If, yes, then how can I do it?
Alex Ljamin's user avatar
3 votes
2 answers
262 views

Migrate Craft CMS installation from PgSQL to MySQL - any hints?

We need to migrate a Craft installation with a pgsql dump to MySQL. Any hints on the procedure? Thanks, Matthias
Matthias Redl-Mann's user avatar
2 votes
1 answer
62 views

Mass enable entries

I'm trying to set statuses to enabled in mysql. Around 150k entries. The tables are elements and elements_sites. Set status to 1. The query runs OK. In the cp is also everything fine but entries don't ...
Mark H.'s user avatar
  • 391
0 votes
1 answer
98 views

How do I upgrade the MYSQL database from Craft 2 to Craft 3 on GoDaddy

How do I upgrade my MySQL DB for a Craft 2 site to Craft 3. I don't have access to the SSH server or use of Composer, so I have to move files via FTP and do everything manually. My client is on ...
Aric Harris's user avatar
1 vote
1 answer
209 views

Craft Internal Server Error

I am getting the following error: Internal Server Error CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #34 of SELECT list is not in ...
MikeeeG's user avatar
  • 131
1 vote
1 answer
247 views

How to query in MySQL all entries with related categories

I have a custom product grid not associated with Craft Commerce. I am wondering, how can I query, in the SQL database, all entries and their related categories?
Akuden 's user avatar
0 votes
0 answers
548 views

Control panel - Entry indexes very slow

Craft CMS 3.3.15 PHP 7.1.3 MySQL 5.5.42 I have a structure with 360 entries. Right now in the CP it takes 3.5 - 10 seconds to load the first 50. And another 3.5 - 10 seconds for every additional ...
Syversen's user avatar
  • 485
1 vote
1 answer
2k views

ERROR 1370 (42000) alter routine command denied to user

I am trying to upload my DB using MySQL Workbench but am getting this error: ERROR 1370 (42000) at line 4534: alter routine command denied to user 'detectalocal'@'%' for routine 'detectalocal....
Harwood Digital Desgin's user avatar
1 vote
1 answer
68 views

Using {% cache %} tags around {% template %} includes (or in Header)

I was wondering if it makes sense to wrap these {% cache %} around {% include %} tags that call a separate file with params. Is it better to just include them in the actual file itself? For example, ...
James Sudimak's user avatar
2 votes
1 answer
487 views

Can't backup DB locally with MAMP PRO 5.5.1

I have followed the instructions for this article (https://craftcms.com/guides/database-backups-in-craft-3-with-mamp) to get local backups working with MAMP. However, when I attempt a backup, I get ...
Mike's user avatar
  • 699
2 votes
1 answer
473 views

Local DB SQL 'CDbException' Errors on Craft 2 site

Just tried to get a local site working again but getting all sorts of issues. I have updated the website online and downloaded the database, installed locally. I have also the craft/app folder to my ...
richardpixel's user avatar
1 vote
1 answer
199 views

Is MariaDB required with Craft CMS or can MySQL be used?

I am currently installing Craft CMS on a test server, The server runs other development services. Currently installed on the server is MySQL 14.4. Is Mariadb are requirement or can I utilise MySQL?
Ian Jenkins's user avatar
2 votes
2 answers
440 views

Get last item added to cart

Does anyone know a nice way to get the last lineItem(s) added to a cart in craft commerce via twig template? Example use case, an 'added to cart' confirmation page. I know for this you could query ...
Seraphim Jester's user avatar
1 vote
1 answer
603 views

Can't Backup Database - "Failed with exit code 1" (WAMP Server)

I'm running Craft 3 on a local windows machine, but every time I try to update certain plugins (or Craft itself) I get a message "Couldn't back up the database. How would you like to proceed". The ...
theAdhocracy's user avatar
0 votes
0 answers
133 views

Unable to delete Entry: Numeric value out of range

I have a Structure section that I converted to a Channel. I then tried to delete an Entry Type from the Control Panel and get the following error: {"error":"SQLSTATE[22003]: Numeric value out of ...
Ben Parizek's user avatar
  • 13.4k
1 vote
0 answers
154 views

Database Query in debugger consistently showing over 2000ms

In trying to optimize my Craft 3 site, I have discovered that it's apparently taking longer than expected to query my database. The duration for the apparent culprit is typically between 1900 and ...
Shad's user avatar
  • 451
1 vote
1 answer
145 views

Craft 2.X Local setup error – Craft not connecting to MySQL (via Sequel Pro)

Novice dev here, really struggling to get my local setup functioning. After a couple of days of wrestling with Apache config settings, I finally have Craft connecting via a VHOST setup. The problem –  ...
J. Ktz's user avatar
  • 21