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
1 vote
1 answer
21 views

How can i display table admin grid to module

ref.like this >> from this to this
Bu By's user avatar
  • 23
1 vote
1 answer
19 views

Attempts to reindex catalog_product_price throws SQLSTATE[42000]: Syntax error or access violation: 1064 on Magento 2

Recently I've been unable to reindex Product Price (catalog_product_price) on Magento 2.4.6. When I run 'php bin/magento indexer:reindex catalog_product_price' from the CLI, I get the following output:...
mcpacific's user avatar
0 votes
0 answers
24 views

Finding attribute option value between configurable product and its simple products by sql query

Using Magento 2.4 MaySql 8 I am investing now a lot of time to try finding the option_id (red marked) of the connected simple product to the configurable products. I ended up in the following tables: ...
Samuel Demir's user avatar
0 votes
0 answers
34 views

How to add custom checkout fileds fetched from DB?

How can I make a new, custom, checkout fields fetched from DB? I have created a new table where I keep fields names, also I created a Model, Resources, ResourceModel (admin can modify or add new one ...
miguelsantos69's user avatar
1 vote
0 answers
10 views

Error - SQLSTATE[42S02]: Base table or view not found: 1146 Table 'aee9c6e2_iy62GL.catalog_product_index_price' doesn't exist,

I have hosted my website in Nexuss and my website crashed due to a server issue recently. They have replaced my website with the backup and brought back the website. Magento version 2.2.2 But my ...
Mujahidh's user avatar
  • 2,701
1 vote
1 answer
19 views

Update index value using patch in magento 2.4

Currenty, order_id is set as unique and i want to set as the index. Please help me on this. <?php declare(strict_types=1); namespace Abc\Xyz\Setup\Patch; use Magento\Framework\DB\Ddl\Table; use ...
Kushal Dani's user avatar
  • 2,084
0 votes
1 answer
39 views

Element 'item': This element is not expected. Expected is ( argument ) when in developer mode

I am getting this error: Element 'item': This element is not expected. Expected is ( argument ) when run command like: php bin/magento cache:flush. I try to get back production mode but still get the ...
it's me's user avatar
0 votes
1 answer
49 views

How I can search in database for a category given in url?

Upon development I want to reindex only specific categories because reindexing takes too long. Therefore I am whipping a quick commang where I need to provide a category url and from that triggerring ...
Dimitrios Desyllas's user avatar
0 votes
1 answer
49 views

Error while saving Category in Magento 2.4.6-p1

When I try to save a category I am getting cloudflare timeout error and the category is not getting saved. When I checked the exception log I found this error : SQLSTATE[HY000]: General error: 1205 ...
Akhilesh's user avatar
  • 179
0 votes
1 answer
112 views

Mysql error MySQL doesn't yet support drop existing primary key without adding a new primary key

need help regarding the issue, All of the sudden our production environment we are getting issue during upgrade command SQLSTATE[42000]: Syntax error or access violation: 1235 This version of MySQL ...
Waqar Ali's user avatar
  • 2,284
0 votes
1 answer
35 views

How I can find what values must have `MAGE_RUN_CODE` and `MAGE_RUN_TYPE` for each store/website url from db?

I am transfering a magento website and I have lost nginx settings. But I have full access in the database. In my case I want to find out upon each store url what values must have the MAGE_RUN_CODE and ...
Dimitrios Desyllas's user avatar
0 votes
1 answer
81 views

Import Order from Magento 1 to Magento 2

I need to import orders from m1 to m2 and available orders in m1 are a minimum of 2 lakh on the m1 website. So I thought we were going with SQL and importing orders using SQL. if anyone has created an ...
Viral Patel's user avatar
  • 1,005
0 votes
1 answer
67 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 ...
amitshree's user avatar
  • 6,896
0 votes
1 answer
44 views

Migration SQL ERROR 1062 (23000) Duplicate entry 'NULL'

I'm trying to move a live site to a dev server. Export SQL has been done with phpmyadmin. When importing via CLI; mysql -u "user" -p "name_new_database" < bupsqlfile.sql I get ...
bcnmm's user avatar
  • 21
0 votes
0 answers
31 views

How I can seed a user with a quote?

I am developing a functionality where I need a user with quoted. But for development speed I want to create via command-line a single user with 2 quotes for a specific website. Is there a tool that ...
Dimitrios Desyllas's user avatar
0 votes
1 answer
65 views

How I can seed products into database directly?

Sometimes I have magento installations where my coleagues do edit files in ./vendor folder. Therefore, using magento's seeder will require extra dependencies and may break the ./vendor folder. As a ...
Dimitrios Desyllas's user avatar
0 votes
0 answers
37 views

Magento 2 DB Locks

I'm running Magento 2 and since a recent upgrade my DB seems to be having DB locks quite a lot, yesterday it happened at least 3 times, my developers are unable to find the source of the problem and ...
Sparetoolparts's user avatar
0 votes
1 answer
38 views

Magento 2.4.3 - The store that was requested wasn't found. Verify the store and try again

when customers are trying to create a profile on our client's website they get the following error message: "The store that was requested wasn't found. Verify the store and try again." After ...
Jan-petter Havna's user avatar
0 votes
0 answers
55 views

Unable to run Magento site on nginx

Using Debian 11, I installed PHP 8.1, PHP-FPM 8.1, Mysql 8, NGINX, Elasticsearch, Magento2 via composer. Now I am able to see the localhost welcome Nginx page and I cant navigate to Magento site. I ...
Leo's user avatar
  • 1
0 votes
1 answer
39 views

Products Using Placeholder Image in Category View

A script was run to clear unused product images to free up space on the server, but instead of clearing unused images, it accidentally cleared a portion of images currently in use by products. The ...
Bluestocking's user avatar
0 votes
2 answers
62 views

How I can create a Model and Save it using Magento2?

I made a seeder custom command in order to populate multiple models for my developemtn easyness: <?php namespace MageGuide\FirstModule\Console\Command; use MageGuide\FirstModule\Model\BlogPost; ...
Dimitrios Desyllas's user avatar
0 votes
0 answers
41 views

How I can reference product SKU as foreign key reference?

In my db_schema.xml I made a table with a pivot one: <?xml version="1.0"?> <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation=&...
Dimitrios Desyllas's user avatar
0 votes
1 answer
162 views

Magento 2.4.6 Opimize database tables

I'm using Magento 2.4.6, I want optimize the database, Some tables have large entries. report_viewed_product_aggregated_daily report_viewed_product_aggregated_monthly ...
MP Raj's user avatar
  • 462
0 votes
0 answers
34 views

How to sort products in Magento by new from date?

I wanted to sort products by new from date , please see the query but it is not working perfectly $collection->getSelect() ->joinLeft( ['catalog_product_entity_datetime' =>...
Mark's user avatar
  • 43
0 votes
1 answer
31 views

Magento 2 PWA setup with Adobe guidance but product images not shown

Refer this https://developer.adobe.com/commerce/pwa-studio/tutorials/ Run Below command php bin/magento catalog:images:resize only shown accessories category images and home page images. if any has an ...
Rahul Prajapati's user avatar
0 votes
0 answers
41 views

Redis consuming to much memory in magento2.4.3

I have installed Redis for page cache and session storage here is the setting : but it takes much memory and the website is slow also it gives the times a dataset is loading in memory error please ...
hamza abbasi's user avatar
0 votes
1 answer
26 views

Export of products in CSV files

Does anyone know why the CSV export file does not appear, when I make the export I get the notification that it is ready, however, the file is not found, this should appear with the date on which the ...
Erick Vernaza's user avatar
0 votes
2 answers
68 views

Magento 2 Database optimization need help, database keep growing!

Magento 2 tables data is showing a total size "5,115,687" , I want to truncate some large tables please guide me can I truncate the following tables without affecting store functionality: ...
hamza abbasi's user avatar
0 votes
0 answers
31 views

Integrity constraint violation: 1062 Duplicate entry '5300-200-0' for key 'CATALOG_PRODUCT_ENTITY_TEXT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID',

After Upgrade Magento version to 2.4.6-p1 , I am getting error on executing setup:upgrade command : Error : Unable to apply data patch Magento\Catalog\Setup\Patch\Data\...
Jantar Mantar's user avatar
0 votes
1 answer
74 views

Product Attribute not display under Catalog Product List conditions

I created attribute for configurable products. I want to create a page using that attribute. I selected the Catalog Product List option in widget. But i can not see added attribute in the dropdown. ...
Daga's user avatar
  • 11
0 votes
0 answers
31 views

Mapping backorders/allow_backorders & use_config_backorders (Akeneo)

I've not been succesful in mapping these values, as these are not standard product attributes. backorders (or allow_backorders) use_config_backorders I would not mind setting the default value of ...
Bram's user avatar
  • 1
1 vote
1 answer
49 views

How to insert data in database of custom checkout step fields in magento 2.4.6

I have created an new checkout step that has one input field. I want the value of that field to be stored in a database.
Yameen's user avatar
  • 38
0 votes
2 answers
147 views

Add index in existing index in magento2

I want to add an index to an existing index using Setup/UpgradeSchema: $connection = $setup->getConnection(); $tableName = $setup->getTable('sales_order_grid'); $indexName = '...
Jimit Bhavsar's user avatar
0 votes
1 answer
54 views

Magento2: How to uninstall sample data from database

Does anyone know how we can remove the sample data from the database? Please let me know if you have any suggestions. Note: I don't want to remove the sample data modules, I'm looking for something ...
Suresh Chikani's user avatar
2 votes
1 answer
29 views

Admin customer spam

I removed customer spam from the database. But, the admin customer display still shows those customers.
Jim Todd's user avatar
0 votes
1 answer
109 views

Is it possible to get Country Name using Select Query in Magento 2 DB?

I am trying to get the list of customers from the database directly using Mysql Query. SELECT ce.email As Email, ce.firstname As Firstname, ce.lastname As Lastname, COALESCE(NULLIF(cae.country_id,''), ...
Chirag Prajapati's user avatar
1 vote
0 answers
44 views

Integrity constraint violation error magento2.4.3

I am getting this error: main.ERROR: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'last_visit_at' cannot be null, query was: INSERT INTO customer_visitor (customer_id, session_id, ...
hamza abbasi's user avatar
0 votes
2 answers
35 views

Magento 2 - Database values to push in production using Git

I want to move system Configuration values and values stored in database to production server using Git. Can anyone let me know how can I push Admin Changes to Production using Git. Is it possible ...
user3411's user avatar
0 votes
2 answers
430 views

custom attribute value not save in the Database

<?php declare(strict_types=1); namespace Vendor\Module\Setup\Patch\Data; use Magento\Eav\Model\Config; use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory; use Magento\Eav\...
Nabeel shahbaz's user avatar
0 votes
0 answers
35 views

When a simple product is removed from grouped product in admin panel in Mage 2.4.5. Here comes issue

In Magento 2.4.5 vanilla when creating a new grouped product, let's suppose this grouped product already has 20 simple products. Step # 1: Add the 21th product in grouped product table in product edit ...
HamzaKhalid273's user avatar
0 votes
1 answer
42 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.
Kushal Dani's user avatar
  • 2,084
0 votes
1 answer
275 views

Magento CE breaks with MariaDB 10.6.13 galera cluster

I run a Magento CE store with 3 DB servers (galera cluster). When upgrading Magento from 2.3.4 to Magento 2.4.6, also upgraded MariaDB from 10.4 to 10.6, and PHP from 7.4 to 8.1, to match Magento ...
MAX's user avatar
  • 1
0 votes
0 answers
29 views

How to merge 2 websites into 1 website with 2 stores

I have 2 Magento websites (Web A and Web B with different Magento installations) but I need a single Magento installation with 2 websites how to merge 2 different websites to a single installation ...
Pawankumar's user avatar
1 vote
2 answers
104 views

Deleting specific orders and related data via SQL

I am currently looking at deleting old order-related data (includes order, shipment, invoice, creditmemo and payments) from a Magento installation (currently 2.4.5-p1). I am ignoring the aggregated ...
fearfelt's user avatar
0 votes
2 answers
58 views

sudo php bin/magento module:status didn't run?

I was trying to run this command but the error raised like this PHP Warning: require(/var/www/medical/bin/../app/bootstrap.php): Failed to open stream: No such file or directory in /var/www/medical/...
Ansari's user avatar
  • 435
0 votes
0 answers
23 views

Import and update wholesale prices with different price ranges according to quantity in Magento

I want to update the prices for wholesale customer group from csv. The csv format is like this How can I update these to database? Or help me by letting me know the table and column names where the ...
MD TAREK HOSSEN's user avatar
0 votes
2 answers
81 views

Scable qty going to nagative value

In Magento2 Scalable qty going to nagative value. Is there anyone have idea which cases Scalable Qty going to nagative value?
Arti patel's user avatar
0 votes
1 answer
56 views

Magento2: get values to databse

I'm trying to get values from the popup model of radio buttons into the database and I'm not getting that, what am I doing wrong? BLOCK FILE <?php namespace vendor\ThreeYearOrders\Block; use ...
Bayzel's user avatar
  • 177
0 votes
0 answers
13 views

Magento2 Image not saving into custom db table

Created a form fields are saving data into db table but image data is not getting saved. $data = $this->getRequest()->getPostValue(); Tried to print but it dose not showing image data. My ...
Naman Bapna's user avatar
0 votes
1 answer
35 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 ...
Jayreis's user avatar
  • 695

1
2 3 4 5
66