Questions tagged [sql]
Questions about using raw SQL queries. For questions about the database in general, use the database tag instead, for questions about the Magento database access layer use the appropriate tag, like: eav, model, resource-model, collections, install-script
665 questions
0
votes
5
answers
126
views
Magento Website Malware
I have Magento website and it have some kind of the malware that did SQL Injection, and also on each reload of my page it add scripts to my DB under cms_block content of each record, also on website ...
0
votes
1
answer
94
views
SQL Foreign Key issue preventing setup:upgrade from completing
I am running into an issue when trying to run setup:upgrade, to where it fails with saying;
SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP '...
0
votes
1
answer
115
views
Magento 2 SimiCart - Magento 2 Mobile App Builder
We are using Magento 2.4.2-p2 version with SimiCart - Magento 2 Mobile App Builder
We are struggling from where category_id is coming
File name - app/code/Simi/Simiconnector/Model/ResourceModel/...
0
votes
1
answer
84
views
Where is this query coming from?
I noticed my DB CPU creeping up and hitting 100% this week. Looking into the MySQL process list I saw 4 instances of the same query running. These queries never finish though, one has been running for ...
0
votes
3
answers
147
views
disable products without images via SQL
Any idea how to disable products without images via SQL ?
Magento ver. 2.4.3-p1
Thank you
0
votes
2
answers
94
views
Issue with implementing unique_purchases column in main table using leftJoin in Grid ResourceModel
I have a SQL query that does what I need
SELECT ipi.*, COALESCE(unique_purchases, 0) AS unique_purchases FROM mst_inventory_planner_inventory AS ipi LEFT JOIN ( SELECT product_id, COUNT(DISTINCT ...
0
votes
1
answer
440
views
List of log tables to safely truncate in Magento 2?
For Magento 1, here is a list of log/cache tables which can be safely truncated.
Is there a similar list of tables for Magento 2, which can be truncated/deleted without deleting base data?
Please note ...
0
votes
1
answer
1k
views
Magento 2 Website Id 0 Not Found Even though it IS in the Database SQL Tables
Running php bin/magento setup:upgrade returns this error
'The website with id 0 that was requested wasn't found. Verify the website and try again.'
Running php bin/magento setup:db-data:upgrade will ...
0
votes
1
answer
103
views
Setup Production Database on Staging server in Magento 2.4
I downloaded the production database. Now I want to setup the database on the staging server. So what sanitize process I have to apply on the database before uploading to the staging server.
0
votes
3
answers
854
views
How can I remove a condition from a collection
I tried to use two methods to reset or clear the collection but it didn't work.
I am working with the category collection on which I want to remove this part of the condition : (e.created_in <= '...
1
vote
1
answer
2k
views
How to Solve 404 error on frontend?
Getting 404 error on frontend page backend Admin panel is perfectly working frontend page only through error what is the reason behind that
0
votes
2
answers
425
views
Unexplained 'EXPLAIN' SQL Queries in Magento 2 Production Database
Greetings forum members,
I hope this message finds you well. I am currently facing an issue with my Magento 2 production database and would greatly appreciate any insights or assistance from the ...
0
votes
1
answer
116
views
Custom sql to get Magento2 EE reward point data
I am trying to write a custom sql that will provide to me data related to the Magento2 EE reward points. My issue is that my queries seem to be showing 0 as the result which can not be because when I ...
0
votes
1
answer
139
views
Magento 2 - Query to know the user who update the price of the product
I am very new to magento. What is the query to to know who was the user who updated the price of a product?
I just want to know the query, not the code.
Thanks in advance.
0
votes
2
answers
605
views
Convert SQL Select Query to Magento Collection
I have a complex sql select query which actually returns sales report against specified categories. I want to load data as a collection to display but I'm not able to convert the query into Magento's ...