Questions tagged [database]

Questions related to Magento's MySQL database, for example, the table schema, plain SQL queries or database configuration. For questions about the Magento database access layer, use other tags, like: eav, model, resource-model, collections, install-script. For questions about SQL queries in particular, the SQL tag is appropriate too.

Filter by
Sorted by
Tagged with
0 votes
1 answer
24 views

Where is the Barcode Attribute Stored in the Database

I want to run some queries for reporting purposes and need to display the barcode of each product, but I cannot find it. I have followed the answer on the following post but I still cannot get the ...
user avatar
0 votes
1 answer
11 views

is it safe to delete magento 2 table:fl32_csp_report?

I have the following table, named fl32_csp_report, size: 2.5GB. it's very huge table, and it affected the visiting speed when customers comes to my website. My store has been just updated from ...
user avatar
0 votes
1 answer
12 views

how can i install magento 2.4.4 and 2.3.3 having different server requirements on local system for development in linux

i know that we can switch between different version of php in ubuntu with the commands sudo a2dismod php7.1 sudo a2enmod php5.6 but the mysql requirement for the old and new magento setups are also ...
user avatar
0 votes
1 answer
19 views

What methods do you use to optimize the work and performance of the backend part (.php)?

I want to try to optimize the performance of Magento 2. After searching this question, I see that for the most part everyone removes modules that are not used on the project or that are obsolete. But ...
user avatar
1 vote
2 answers
120 views

Magento 2 : Create a JOIN

I am trying to display a report which GROUP BY : SKU and Subsidiary. So instead of displaying each RMA in different rows, I am trying to display Filtered Report, Group by SKU and 2nd group by ...
user avatar
  • 58
0 votes
0 answers
14 views

Compare DB changes between Magento 2.3.4 and Magento 2.4.3

I am in the middle of a migration process between Magento 2.3.4 and Magento 2.4.3. Regarding the code changes, I am in a good spot. Everything is under control. However, it is not 100% clear to me how ...
user avatar
  • 33
0 votes
1 answer
28 views

Magento 2: How can I add new field and save data to newsletter database table?

How can I save data in a new field in newsletter table of database? This is how I created my module based on other answers, but no one of aproaches worked. The fields of column c_firstname is always ...
user avatar
  • 1
0 votes
2 answers
36 views

Reset Order Numerb and Invoice 2.4.4

i finish to do a lot of test so now i'd like to reset order progressive number and invoices.. Anyone can help me with mysql code for doing this reset? Thanks!
user avatar
1 vote
1 answer
47 views

Return custom db fields via graphql resolvers

I've added custom fields to sales_order Now I want to return them in customerOrders GraphQL query as a value from database. How can I do it without fetching the order from database again in Resolver ...
user avatar
0 votes
0 answers
32 views

magento 2.4.3-p2 search result getting We could not find anything for matching the selection

I have elasticsearch 7 and M2.4.3-p2 On the category page to working fine and search pages Magento display: We can't find products matching the selection. (MYSQL engine works correctly) before 2.3.3 ...
user avatar
0 votes
1 answer
8 views

JSON functions in MBI SQL builder

According to the docs, all functions that are not mutations should be included in the SQL syntax. I have a MySQL integration in MBI, but when I try to test some basic SQL functions such as ...
user avatar
1 vote
2 answers
32 views

How to change swatch from grid view to list view

I'm new one here. I have no experience with magento developing. I want to change my product swatch from list view to grid or grid view to list view. I have also attached a picture of my product page. ...
user avatar
0 votes
0 answers
21 views

Tons of sleep processes in mysql from magento causing "connection refused"

On a Magento 2.3.3 site, a couple of times a month our site will go down (or run slowly to the point that it is unusable due to timeouts) for a seemingly unknown reason. The first thing I look at is ...
user avatar
0 votes
1 answer
24 views

Get configurable's items quantity SUM using mysql

I was wondering if there is a way to get the sum of the stock of simple products in a configurable product using mysql. As an example: configurable sku = product_1 simple prodcuts associated to the ...
user avatar
0 votes
1 answer
42 views

Remove special character from input form at checkout?

I'm trying to remove a dash ('-') from an input field (Zip Code) at checkout, but can get it to work. I want to clean just the initial character if a user enters the dash at the beginning of the zip ...
user avatar
  • 181
0 votes
2 answers
53 views

Magento 2 - Add column to a table by using the declarative schema

I try to add two columns to the sales_order_grid table by following the declarative schema. Attempt: <?xml version="1.0"?> <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
user avatar
  • 2,403
0 votes
2 answers
30 views

There has been an error processing your request: Error log record number: d11d948cb3596b359566fa162df65dbf6baef2446fe384f4476057675f3dd95f

Exception printing is disabled by default for security reasons. Error log record number: d11d948cb3596b359566fa162df65dbf6baef2446fe384f4476057675f3dd95f i run the record log number in putty this what ...
user avatar
0 votes
1 answer
27 views

PHP and MYSQL versions for Magento 1.9.4.0, 2.4.2-p1 and 2.4.4

I have 3 websites: Website 1 still runs on Magento 1.9.4. Websites 2 and 3 run on Magento 2.4.2-p1 which we are having terrible problems which I believe are because the Magento Migration Tool messed ...
user avatar
  • 306
0 votes
0 answers
16 views

Where in Magento 2 database does minimum quantity gets saved per SKU and customer group?

Where can I check if „Not logged in“ customer group minimum quantity allowed per SKU is saved in Magento database correctly? Problem is, that quantities <1 do not seem to work at checkout for guest ...
user avatar
  • 27
1 vote
1 answer
168 views

Magento 2.4.4 error in setup:upgrade

I completed successfully composer update magento 2.4.3-p1 to 2.4.4 Also my template and all modules are ready for 2.4.4 magento But in setup:upgrade I got this: Unable to apply data patch Magento\...
user avatar
  • 912
0 votes
1 answer
69 views

Multiple SQL queries in Magento 2 can't be executed

I have a custom module and i want to define a Mysql Function in Setup/InstallSchema.php: $query = 'DELIMITER $$ DROP FUNCTION IF EXISTS getQuantity; CREATE FUNCTION getQuantity(PID ...
user avatar
0 votes
1 answer
34 views

How is working insertOnDuplicate() in magento 2

Who can help me and explain how work insertOnDuplicate in magento 2. Thanks for answer.
user avatar
  • 43
0 votes
0 answers
33 views

Magento 2 Custom attribute won't update for particular product

I've created few custom attributes where customer can list a cons and prons of the product. After filling 'ms_cons' and 'ms_prons' text displays on the frontend. I have problem with one particular ...
user avatar
  • 3
0 votes
2 answers
76 views

1146 Table 'mage.flag' doesn't exist

Suddenly I started to see this issue below in all URLs in my Magento 2.4.4 3 exception(s): Exception #0 (Magento\Framework\DB\Adapter\TableNotFoundException): SQLSTATE[42S02]: Base table or view not ...
user avatar
0 votes
1 answer
33 views

Magento 2 – Item with the same ID already exists

I am getting this error when try to open product Report. Anyone can help me on this How to i can fix this issue ? Thanks
user avatar
1 vote
2 answers
31 views

Maagento 2 : getting error when Import database

I have run this command:- mysql -u magento -p database < database_file.sql I have got the error:- ERROR 1062 (23000) at line 5447: Duplicate entry '7-41-0' for key 'catalog_category_entity_int....
user avatar
1 vote
1 answer
72 views

How to execute multiple DB queries?

My query is: /** * @var \Magento\Framework\DB\Adapter\AdapterInterface */ private $connection; $query = <<<SQL LOCK TABLE {$tablename} WRITE; ...
user avatar
0 votes
0 answers
13 views

How to upload multiple files from admin product edit page and disaplay it on product details page Magento 2

I need to develop functionality in which i want multi-file upload control on the product edit page in back-end and that uploaded files are displayed on the product view page in front-end. can anyone ...
user avatar
0 votes
1 answer
19 views

Need to join two tables

Need to join two tables sales_order TO JOIN sales_order_item ON entity_id = order_id Below is what is existing and would like to join sales_order to this. Collection.php <?php namespace Magecar\...
user avatar
  • 35
0 votes
1 answer
55 views

Magento 2 - Database connection error

I have this error, my database is in a service other than magento and the user used to connect to the database is admin, can you help me? PDOException: Caught PDOException (500): SQLSTATE[HY000] [2002]...
user avatar
  • 1
1 vote
0 answers
163 views

Error - Database 'DB_Name' does not exist or specified database server user does not have privileges to access this database magento 2

I am facing an error after upgrading Magento 2.3.6 to Magento 2.4.4-beta4 version. Error - Database 'DB_Name' does not exist or specified database server user does not have privileges to access this ...
user avatar
0 votes
1 answer
9 views

Show only items that return a result

I am displaying data from database but how would i only show items that return a result from $qtyBackordered use \Magento\Framework\View\Element\Template; use \Magento\Framework\View\Element\...
user avatar
  • 35
0 votes
0 answers
10 views

How to get 4th image of a Product so that I can assign it a particular Attribute (hovering)?

I have a requirement to assign the 4th image of a product a custom attribute 'hover_image', which will be shown when a user hovers over the product on PLP. I have done this using position value stored ...
user avatar
0 votes
0 answers
34 views

How to update table with model collection

I am trying to update the customer_entity table. But I am doing a left join with customer_address_entity. I want to update the group_id only when store_id matches my customer variable. Is this ...
user avatar
  • 45
0 votes
0 answers
110 views

Docker magento 2 setup issues with Mysql (markshust/docker-magento)

Facing a MySQL connection issue while Magento2 setup with docker at local I have followed the steps mentioned in the existing project in the below link markshust/docker-magento: Mark Shust's Docker ...
user avatar
  • 1
1 vote
0 answers
50 views

Magento 2 Mailchimp Abadoned cart email not working

In the current Using version we are using Magento 2.4. We are Using this Mailchimp Magento extension - https://marketplace.magento.com/mailchimp-mc-magento2.html We upgraded the Magento version from 2....
user avatar
  • 1,143
0 votes
0 answers
44 views

Magento 2: How can I fix this Category Products index MySQL Error?

I have migrated M1 simple products into my M2 database and as a result have had to remove/edit some incorrect eav_attribute table entities. When I reindex Catalog Products I now get this error which ...
user avatar
0 votes
0 answers
19 views

Split Database with Foreign key from another Database

I am using Split Database, where I have created 3 parts: Default Quote Sales. I have created one Table using db_schema.xml file from that I am creating an custom table, but I want to add a Foreign ...
user avatar
0 votes
1 answer
39 views

Magento 2 : How to add sub query in custom collection

Adding Join: $subquery= new \Zend_Db_Expr('(SELECT @row_number := 0)'); $resourceCollection->join(array('payment'=>'sales_order_payment'),'main_table.entity_id=parent_id',['main_table.entity_id',...
user avatar
  • 1,582
0 votes
1 answer
90 views

Product query is suddenly really slow, because wrong index is being selected in MySql

Issue suddenly started to occur on our live site, dev site has the same database, but just with older data and same query is running completely fine there. I've also tried dumping those three tables ...
user avatar
  • 1
0 votes
0 answers
9 views

Database issue with entity_type_id

Today I discover something strange in our magento 2.4.3 database. We have wrong order in entity_type_id of table eav_entity_type. A clean magento instance has this order: Our magento instance has ...
user avatar
  • 912
0 votes
1 answer
12 views

Magento 2 Add additional fiels to sales_order and pass addData before save

I am doing a custom order placement based on the API data I receive, I have to introduce the new column on the sales_order table whet I have to add them before order save using addData or setNewfield, ...
user avatar
  • 434
0 votes
1 answer
34 views

Magento install failed on cPanel

When i try to install Magento v2.4.3 through installatron on cpanel, it throws an error : Error: A database query has failed. Is the entered database information correct? Does the account have ...
user avatar
  • 1
0 votes
1 answer
51 views

setup:db-declaration:generate-whitelist does nothing - no results or errors

M2.4.3-p1. Trying to use db_schema.xml as that appears to be the way forward. setup:upgrade is not adding my tables. setup:db-declaration:generate-whitelist is not generating the whitelist. Basically ...
user avatar
0 votes
1 answer
25 views

where can I find refunds in cash and refunds in store credit in the database?

I'm looking to compare refunds that have been paid in cash vs by store credit in the database, but I cannot find any info myself.
user avatar
0 votes
1 answer
28 views

Code to Get row_id or entity_id for catalog_product_entity_varchar table for join query of product name Community vs Commerce editions

I'm using some code to join the catalog_product_entity_varchar in order to get the product name and it works for Community edition using entity_id but my client is hosting with Magento Cloud and there ...
user avatar
0 votes
0 answers
37 views

How to send inquiry email to customer on admin reply in magento2.4.3

Hello all magento developers, I want to send inquiry email notification to customer when admin can add reply to customer inquiry in magento 2.4.3. can anyone have idea then please share here, Thank ...
user avatar
  • 498
0 votes
0 answers
27 views

sensitive URL available for anyone, help!

I'm facing an issue that specific URLS are available for everyone, these URLS contain sensitive file and should be displayed only for that specific customer. For example: John123 has an invoice that ...
user avatar
0 votes
0 answers
22 views

Require SQL query to count certain products in categories

We would like to get a SQL query to supply either a listing of or a number of (count(*)) for the following Specified Store (where store ID = X ) AND Specified Category (where category ID = x )
user avatar
1 vote
0 answers
80 views

How to prevent deadlock when updating product attribute?

I have built a seperate module for my ERP and custom import from excel file to update product attribute. These two modules using this Magento function to update product attribute: /* Magento\Catalog\...
user avatar
  • 177

1
2 3 4 5
73