Questions tagged [mysql]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
17 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 ...
1
vote
1answer
16 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 ...
0
votes
0answers
9 views

SQL to delete all entries and a matrix field from the database direct due to Craft issues in the admin

What would be safe SQL commands to delete all entries from the database? And similarly to delete all content from a specific Matrix field? The reason is because Craft seems to have an issue with ...
1
vote
1answer
29 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?
1
vote
1answer
21 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 ...
0
votes
0answers
35 views

Error when creating field “1118 Row size too large”. Is it safe to change Dropdown field type to TEXT?

I’m running into a wall in Craft when adding a boatload of fields. The error I’m getting is SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large. The maximum row size for the ...
1
vote
1answer
48 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 ...
0
votes
0answers
35 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 ...
0
votes
0answers
27 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 ...
1
vote
1answer
40 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 –  ...
1
vote
1answer
43 views

templatecachequeries entries with of 157.000 characters in query column

after enableling querycaching in craft3 I found rows in templatecachequeries with big amount of characters in the query field. I decoded it with base64 and got this as the largest entry: query_length:...
0
votes
0answers
41 views

Emojis on Craft 3 front office

I'm making a blog. I have a wheelform comments input type that needs to be stored as utf8mb4 in the local database. My MySQL database version 5.6 is configured to utf8mb4 in the database, tables, ...
0
votes
0answers
41 views

Plugin failed to install with mysql error message

I've sent this to craft support but wondered if anyone on here could shed any light on this for me. I'm working on an external dev site I've upgrade a craft2 site to craft3. Which was successful. ...
1
vote
1answer
243 views

What is CDbException Error: SQLSTATE[42000]: Syntax error or access violation while moving a site to remote?

CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #28 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'site....
1
vote
1answer
94 views

MySQL “Access denied for user” after moving to new server

I've moved my Craft 3 installation to a new server. When connecting to the original database, everything works fine. However, when trying to connect to a new MySQL database (I've tried hosting this ...
1
vote
2answers
30 views

Upload failed. The error message was: "SQLSTATE[23000]: Integrity constant violation:

I'm getting this strange error when I'm trying to upload an .jpg in the assets. Env: Localhost Craft version 3.1.8 MAMP: - PHP(7.2.7) - MySQL: 5.7.21 Upload failed. The error message was: "...
0
votes
1answer
140 views

ERR_EMPTY_RESPONSE when accessing order data (MAMP)

I've got a local installation of Craft 3.0.37 and Craft Commerce 2.0.0-beta.15 running on MAMP. When completing an order, an empty response is given by the browser. The same thing happens when trying ...
1
vote
1answer
236 views

How to connect to a Remote DB using CraftCMS 3.1+

I tried using Andrew Welch's craft-connect plugin, but the plugin was throwing an error on the REMOTE_DB_SERVER variable. I commented the variable out in the .env file, but I still could not connect. ...
1
vote
1answer
62 views

# of MySQL connections

Assume my website (developed using Craft, of course) is expected to have 1000 concurrent access. How many MySQL db connections would be required to open? Does Craft control this or does it depend on ...
1
vote
1answer
240 views

Incorrect user-level lock name - Local Vagrant Environment - Craft 3

When creating a new field, I received a Database Exception error - SQLSTATE[42000]: Syntax error or access violation: 3057 Incorrect user-level lock name '/var/www/storage/runtime/compiled_classes/...
0
votes
1answer
231 views

Importing a database from backup

Long story short, I migrated from Craft 2 to Craft 3 but had an issue with a plugin. Database Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'emailTemplateId' in 'where clause' The ...
0
votes
0answers
191 views

Setting up Craft 3 database backup command for a remote database server

I have my Craft 3 database on a separate server than my Craft webserver (load balancing) and when I use the download database backup function in Craft 3, it doesn't know where to look. I haven't ...
1
vote
1answer
45 views

What could the possible causes be for a mismatch between `craft_fields` and `craft_fieldlayoutfields` MySQL tables?

I'm debugging an Internal Server Error on a site developed by, well, not me. :p The site has an absolutely enormous Matrix field called "Modules", and the blocks in said field have so many fields that ...
1
vote
2answers
104 views

Find entries that use a specific block in their Matrix field?

Suppose a Mtrix field named MyMatrixField has three blocks called Text, Images, and Buttons. What MySQL query would list the section and title for all entries whose MyMatrixField field has a Buttons ...
1
vote
1answer
81 views

Joining sections (Channel) to query based on a related item attribute

I've been trying this for a while now, so might have read this before. Sorry about that, I'm struggling really hard to get this right. At first I tried (wrongly) with the eager load features. I have ...
1
vote
0answers
21 views

Paginate entries based on related status

So, let's assume I have two channels. events and movies, being events the screening time of each movie. In the admin, in the event entry, you can select one movie. The movie could be disabled. The ...
2
votes
1answer
68 views

Error on import to Craft production db

I just copied my database across from local server to production server. I used Craft's control panel to create a backup. Then I used Sequel Pro to import this into the live server. I got this error: ...
1
vote
1answer
415 views

Randomly getting the “Integrity constraint violation” sql error on saving entry

Randomly getting the "Integrity constraint violation" sql error on saving entry from backend. There no apparent cause of this at least not that I can see, because the same post saves without errors ...
1
vote
1answer
48 views

Use utf8mb4 for database operations

the plugin I'm currently working on has to store user inputs which might contain 4 byte unicode characters like emojis. MySQL is not able to handle this with a utf-8 charset. It works if the charset ...
1
vote
1answer
1k views

MySql 5.7 error - field doesn't have a default value

We've just switched server for one of our sites and I am now encountering a MySql error on one of our plugins. The MySql version on the new server is 5.7 and throws an error as a field has no default ...
1
vote
1answer
348 views

Problem connecting to MySQL db on installing Craft 3

Having installed Craft 3 using Composer, I'm attempting to run the Craft setup. Everytime I try, I get the following error: Testing database credentials... failed: SQLSTATE[HY000] [1044] Access ...
1
vote
1answer
71 views

Does Craft do joined calls or multiple ones when fetching the related items? [Element API]

I'm checking Element API's performance to decide if it's a good idea to replace my own custom API with Element API. Right now, when fetching the related items (Via fields or matrix elements), my API ...
0
votes
1answer
152 views

Craft 2.6 incorrect string value SQL error for 4 byte UTF-8 characters when saving entries

On a Craft site that uses the Dukt Twitter plugin I have started seeing SQL errors when saving certain entries that use Twitter data: CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: ...
0
votes
1answer
301 views

Alternatives to Mamp Pro – which works with Craft CMS

I've been a long time user of Mamp Pro, but I'm getting an error using v3 with Craft3, due to needing to update to Mamp Pro 4, however after some hrs trying to update to Mamp 4, I can't get mySQL to ...
1
vote
1answer
82 views

Install MySQL stored procedure to database on plugin install in Craft 3

I am trying to add a MySQL stored procedure to the database on plugin install in Craft 3. I currently have an install migration calling a function from the safeUp method. In this function I am using ...
1
vote
2answers
152 views

Importing a Craft database error

I dumped from Craft my database from server A and am trying to install it to a fresh copy of Craft on server B. I've got Craft up and running, and when I try importing my Craft SQL file in PHPmyAdmin,...
2
votes
1answer
196 views

Craft 3 Ubuntu installation error via composer setup

After running composer and then initiating craft setup I keep getting this error: Username: [admin] Email: abc@test.com Password: Confirm: Site name: test Site URL: test.com Site language: [en-US] ...
1
vote
2answers
599 views

How do I get past this MySQL error installing Craft 3 using CLI

I am using https://box.scotch.io/ (vagrant). I'm trying to install Craft 3 with the cli, but can't get past these errors: Connection refused No such file or directory One or the other error shows ...
1
vote
1answer
60 views

Publishing entry returns Internal Server Error (1030 Got error 139)

Trying to publish changes in one of 3 locales of an entry gives error: Internal Server Error CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1030 Got error 139 ...
1
vote
1answer
205 views

MySQL CPU pegged on specific query

Very similar (almost exact) to this question: Poor performance on midsized site / Queries without index? CPU keeps getting pegged to 100% for MySQL, which makes the admin interface very slow (the ...
3
votes
1answer
43 views

Workflow for re-using data structures and setups across projects?

I am wondering if there is a way to re-use pre defined field types and image crops over various Craft projects. I currently in the process of e.g. manually defining 20 different image crops I already ...
7
votes
2answers
1k views

Craft CLI RC1 Connectivity Issues with MAMP Pro

I've been trying to run the new Craft CLI for the last couple of versions without any success. I figured maybe since we weren't at RC1 yet that it wasn't fully working. After seeing Ryan's video about ...
1
vote
1answer
97 views

Craft 2.6.2999 install error: Base table or view already exists: 1050 Table 'craft_entryversions' already exists'

I keep getting stranded at the "Oops" modal on install. This is on the third Craft site I've started. The other two Craft 2 sites stood up fine, an I've been developing them for nearly a year. I've ...
1
vote
0answers
67 views

Creating coupon using Charge 2 plugin

I just updated the Charge 2 plugin to latest (version 2.2.1) and when I try to create a new coupon, I get this error: CDbException CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: ...
1
vote
1answer
33 views

Pruning the users table

I have a site that deals exclusively with user generated content. After a few years, the users table is getting to a stage where it can probably be pruned of folk who have registered but not actually ...
2
votes
1answer
182 views

MySQL Error 1064 when trying to create a Matrix

Running Craft Version 2.6.2994 on an EC2 instance that has PHP 7.0.21, and MySQL v 5.6.37 installed. When I try to create a new Matrix, I get the following error when saving. When I test this on my ...
1
vote
1answer
311 views

Base table or view already exists

Getting the following error on production environment when trying to add a new Field. CDbCommand failed to execute the SQL statement: SQLSTATE[42S01]: Base table or view already exists: 1050 Table '...
1
vote
2answers
42 views

What might cause logins to work locally yet not in deployed environment?

We're getting a 404 (or a Craft 'page not found' error) with this path on the remote server: http://foo.example.net/admin/actions/users/login Same database using remote mySQL. Local logins work fine....
1
vote
0answers
81 views

Problems while setting up a cross region Craft website in AWS

In order to create a cross region setup for my craft website, I've created a read-only replica of my RDS DB from North Virginia region to Canada Central region. I'm facing the internal server error ...
2
votes
1answer
410 views

Entry view count in the last 24 hours

I'm working on a typical craft blog with articles. I know there is a plugin that was used to teach craft plugin development that tracks entry visit counts here: https://straightupcraft.com/craft-...