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
1answer
45 views

Unknown column 'entity_id' in 'OLD' in setup:upgrade after 2.3.2 migration

Recently I migrate a site to Magento 2.3.2. composer update run fine and without a problem. But, when I run a php bin/magento setup:upgrade it throws this error: Column not found: 1054 Unknown column ...
1
vote
0answers
31 views

Import new database after category description not showing in magento 2

Hello I have import new database and category description no showing. Description.phtml no working. But in old Database everything is good. is that import Database issue? Where i find error in ...
3
votes
1answer
112 views

Magento2 : Data Not saving in Custom Table

I have created a custom module and trying to save data but not saved data into custom_table. I don't know why? I compared same code with my previous Modules Everything is same. Here is my ...
0
votes
0answers
26 views

Table “catalog_product_super_link” and “catalog_product_relation” shows wrong parent-child records

Trying to get parent-child relation through a mysql query in my extension but wrong detail stored in catalog_product_super_link and catalog_product_relation. Example +---------+------------+-------...
1
vote
3answers
100 views

How to print Product collection mysql query in magento2

In my product page Price sorting not works properly. So i need to know which field value consider for sorting ? the issue occurs in configurable products.How do I print the actual MySQL code that gets ...
0
votes
1answer
26 views

Where is set shipping_description value in sales_flat_order table?

I need to set a new value for the shipping_description column of the sales_flat_order table. I would like to know in which file I can define this value before the order is created in the database ? ...
0
votes
0answers
9 views

How do I add product data and directly to the database, which tables need to be updated in what order?

TLDR: Migrating Opencart to Magento, currently have 300+sku's and 100k+ product pages. What is the best practice for storing complex product data and programmatically adding and maintaining it ...
0
votes
1answer
29 views

Understand EAV structure and related tables to get any attribute

For products I have created new attribute brix_level which is a text field. Now I need products data using SQL. I am good at quries, but the EAV structure is beyond my level :D Can anyone explain ...
0
votes
0answers
17 views

Using query result within another query

This is an odd question, as it's something I've done countless times in the past. I'm simply running a query and returning a single result using fetchOne(), and then using the result in a new query. ...
2
votes
0answers
34 views

Impossible to find core_config_data table

A very noob question: it's my first time working on Magento2 e-commerce and I would like to move pages from IP to the domain name. Reading the documentation, I've found that I've to edit the ...
1
vote
0answers
19 views

How to get data by big data

i have data like this. How to get abc_accountnumber, please help me. It is near the bottom of data object(Mage_Customer_Model_Resource_Address_Collection)#704 (33) { ["_itemsById":protected]=&...
0
votes
2answers
113 views

Magento 2 Commerce cloud database export

I am new in magento commerce cloud. I need to setup the magento store in my local system. I have downloaded the files from the commerce git and it is working fine. But how can I access the database? I ...
0
votes
0answers
23 views

Magento 2 product collection getSelect Order by Case unException Unknown column 'name' in 'order clause'

I need to use ORDER BY CASE name which is product name Query: SELECT `e`.*, `cat_index`.`position` AS `cat_index_position`, `stock_status_index`.`stock_status` AS `is_salable` FROM `...
0
votes
2answers
30 views

Magento 2.3.1 clear carts and start over

I want to clear all shopping carts from database and start from scratch. But I don't want to create problems in database for my customer accounts or store orders. I just want to remove all carts which ...
0
votes
0answers
23 views

How to restore only the product data sheet

I have encountered a very serious bug in magento2.2.6. This bug removed almost all product data from my store. Detailed description link for this bug:https://github.com/magento/magento2/issues/15935 ...
0
votes
3answers
123 views

How to change my url from www.xxx.com/Magento to www.xxx.com

I am running Magento 2.2.7 and my current URL for my store is https://shop.xyz.ca/Magneto and I would like to change it to be https://shop.xyz.ca/ I am set up on Windows Server and using Xampp 3.2.2 ...
1
vote
1answer
42 views

“customer_eav_attribute ” Table what is “input_filter” and what values can you have in there

I See in the customer_eav_attribute table there is a column "input_field", what is that? I see most values are "null2, but i do see "date" and "datetime", what other values can you have?
0
votes
0answers
16 views

Magento SQL Query Tuning

My Magento Store that I have taken over my another dev is currently displaying a high Time to First Byte (TTFB) of around 1s. I'm aware that lots more goes into this number that SQL queries alone, ...
0
votes
0answers
19 views

Fetch list of customer address having unique firstname and lastname from some specific customer group

I need to get list of address form specifc customer group, below is condition; 1) firstname & lastname should be unique in customer address group. I have tried below but it is not working: ...
2
votes
0answers
19 views

MySql file per table idb file 65 rows 88GB in size?

I was hoping someone else may have come across this situation. I have a table called index_event which is part of Magento 1.9.3 and contains around 65 rows. Every so often the physical space taken ...
0
votes
0answers
92 views

SQLSTATE[42000]: Syntax error or access violation: 3057 Incorrect user-level lock name on re indexing

When I run php indexer.php --reindexall command I get following error. PDOException: SQLSTATE[42000]: Syntax error or access violation: 3057 Incorrect user-level lock name 'magento_prod....
2
votes
1answer
54 views

How to convert install/upgrade schema scripts to db_schema.xml files?

I'm following the guide from Magento DevDocs about the Declarative Schema I created a new module with old setup way (InstallSchema.php, InstallData.php) to test the convert install/upgrade schema ...
0
votes
0answers
76 views

Error en multistore “SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name”

When using Magento checkout show Error en multistore(only spanish) "SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '', query was: INSERT INTO `` () VALUES ()"
6
votes
3answers
131 views

How to keep products synchronized in two shops

How can I transfer all products from one shop to another after clicking a button? We have a shop which is a copy of our real shop. We need to keep the products, prices, etc. synchronized in both ...
0
votes
1answer
36 views

How to Get Recently viewed Products in Magento 2

i want to get all data from magento core table table name is report_viewed_product_index i searched on stakeexchange and found some solution but havn't for success class Wbtab extends \Magento\...
0
votes
0answers
21 views

magecatalogrule database tables automatic copies

I have a Magento/2.2 (Community) which is creating every about 30 minutes a copy of magecatalogrule_* database tables. In the last hour: 09:36 magecatalogrule_group_websitebda17fbb 09:36 ...
1
vote
1answer
106 views

row_id vs entity_id in magento 2.3 EE

in magneto 2.3 EE , entity_id is missing in EAV tables , instead row_id is available please explain the difference between row_id and entity_id and the removal of enity_id in EAV tables
0
votes
0answers
148 views

Magento2 Database Lock wait timeout exceeded

In my magento admin panel i am getting below error. SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction, query was: UPDATE flag SET state = ?, last_update = '...
1
vote
0answers
29 views

How to add custom field in checkout page and save them in db and backend in magento2.2.5?

I want to add a custom field in the checkout "Birthday" and "Anniversary" and save them in table quote, sales_order, and sales_order_address and to save them in Backend in sales view order below the ...
3
votes
0answers
65 views

Setting up AWS RDS Read Replica on Magento

My Magento DB hosted on AWS MySQL RDS is running at 100% utilization. I have created a Read Replica so that read query can be served by it. But do not know how to configure it. Does anyone have any ...
2
votes
1answer
36 views

How to join three custom table in magento 2

I want join from Table 1 -> Table 2 has id = custom_id Then join from Table 2 -> Table 3 has Table2.id = Table3.id And will get table1.id if eligible My Table Ex : Table 1 -> Table 2 Table1.id =...
0
votes
1answer
39 views

phpcs possible raw SQL statement

In my code I've got a $connection->query("TRUNCATE TABLE $tableName"); Works great. However using the official https://github.com/magento/magento-coding-standard ruleset it showed the following ...
1
vote
0answers
55 views

Magento 2.x Migration Final Sync 'Delta' Stage when not Migrating from Live Database

In the middle of a Magento 1.6.2 to Magento 2.x migration. I made a duplicate of the 1.6 store/database and migrated the data from that database to the new one. That was probably about 2 weeks ago ...
0
votes
0answers
15 views

Magento1 frontpage keeps loading, but admin panel is working fine

Magento version 1.9.1.0 is installed on the server. When I open the admin panel, site is working fine. But when I open the home page or any category page site keeps loading. It does not throw any ...
0
votes
0answers
29 views

Magento 1.9 running slow on frontend on localhost and production servers

I'm trying to speed up Magento 1.9.0.1. It's taking something like a minute or so on localhost MAMP 5, and page speeds on production are loading over 10 seconds. I've tried full page cache extensions,...
0
votes
1answer
30 views

Magento Shipping country ID is shown as NULL in the reports

I'm using PostgreSQL in my data ware house for reporting purposes, and for a certain report I have to show the sum of revenue for each month grouped by country. When i pulled the report the ...
0
votes
0answers
24 views

How to display numbers of row in table to section in configuration system

I want to count the rows of table and display it to field in section system, can someone help me how to resolve this. Thanks!
2
votes
3answers
171 views

How can I remove not existing images in magento 2

How can I remove not existing images from magento. In the database have images but file is not exist. I want deleted this images from database.
0
votes
1answer
25 views

How to add magento 2 location based search product

Like this how to do in magento 2 location based product search
0
votes
0answers
11 views

Magento2.2.5 I am getting Integrity constraint error while placing order?

{"0":"SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (mm_29.order_custom_engravings, CONSTRAINT ...
0
votes
0answers
45 views

order sale vs purchase order in Magento (not getting the difference)

I dont fully understand what is the difference between Sale Order and Purchase Order in MAGENTO. In my system i have 4 tables that are related to the Sale Order and 4 tables that are related to the ...
1
vote
3answers
203 views

In Magento2, how to get the product description from Sales order table

I want to display the order id, item description, sku and price of products from the sales order and sales order item tables. For some reason, the description columns in my sales order item table is ...
1
vote
1answer
28 views

How to set varchar on installschemas

I would like to add a new column inside the magento2 database. Write now i add a \Magento\Framework\DB\Ddl\Table::TYPE_TEXT as the column type. here is my code if(!$installer->getConnection()-&...
3
votes
1answer
105 views

{“0”:"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.name'

Any Help Highly Admired, i'm using Magento 2.2.8 did all commands,upgrade, reindex, static file , etc still not worked {"0":"SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.name' in '...
0
votes
1answer
36 views

What MySQL Collation should I use for Magento 2.2?

Looked for a Magento 2 version of this question but only found a Magento 1. There's 4 that come to mind: utf8mb4_general_ci utf8_general_ci utf8mb4_unicode_ci utf8_unicode_ci Which one should I ...
0
votes
1answer
28 views

Product Filter By Date Attributes Magento 1.9

So i have created a attributes is future_date Now i want to filter product based on this attribute. I want to filter product whatever match with this date. For an example we setup a date 5th June and ...
1
vote
1answer
26 views

Magento 2 Custom table collection Conditions

I'm facing an issue with the dynamic parameters for the filter $collection = $this->_collectionFactory->create()->addFieldToSelect('field_name'); If I have below code it works fine if the ...
2
votes
3answers
85 views

Magento2: Insert and update operation in custom module Admin-side(through Admin panel)

I have create a database-table. I displayed(grid view with toolbar) the table-records in Admin-pannel. Now I need to know the Insert,Updata and Delete process through admin-side process.Please Give ...
0
votes
0answers
39 views

Unique constraint violation found

when edition the product for the backend, I faced the unique constraint violation found in the Magento-2.3 . I have checked the exception log this shows SQLSTATE[23000]: Integrity constraint ...
1
vote
1answer
24 views

Update sales order immediately after inserted

I want to update the sales order right after it is inserted. I want to reflect the change on the sales order conformation email also which is going to the customer. So i have prepared the below code ...