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
0 answers
5 views

Magento 2 Bestseller report in admin old product_id

I am using magento 2.4.5 and over the last couple years my product_id's have changed a couple times as i use a stock import tool and sometimes i have needed to do a complete reimport instead of a ...
0 votes
2 answers
15 views

Url rewrite error

Can anyone please help me on this? i'm calling all my product name and sku from an external api and save to database but unfortunately when i run cron i'm getting following error on log and the api ...
  • 3
0 votes
0 answers
12 views

Magento 2 After Version upgrade patch_list table does not exist

I've upgraded the Magento-EE from 2.4.3-p3 to 2.4.5, after the successful upgraded the application working fine. But while doing setup upgrade it's showing the following error . Base table or view not ...
  • 1,608
1 vote
1 answer
21 views

I see my MySQL logins on my home page

I have a problem with Magento which for me and a problem because when I stop the Mysql service and I try to go to my web page I have this error : PDOException: SQLSTATE[HY000] [2002] No such file or ...
  • 11
0 votes
0 answers
5 views

Load product eav attribute to Order grid csv export

Hi I have a custom grid which displays sales order items and I need to add a column to grid csv export.The column is an product eav attribute of ordered product.How can I load the product's eav ...
1 vote
0 answers
11 views

How to remove Transaction Id from Sales Order in Magento 2.4.0?

How can I remove the transaction id from the sales order? I have two transaction ids in the Transaction section. I want to remove the latest one. Please check the attached screenshot. is there any ...
0 votes
3 answers
16 views

My sql query to get product count for Attribute

I need the mysql query for the following magento code. Need to get the count of products with the given brand option id. count($this->productCollectionFactory->create() ->...
-1 votes
0 answers
13 views

Phpmyadmin not showing databases

If I login and refresh the page I can see the databases pop up but then disappear.
  • 29
1 vote
1 answer
22 views

How to apply filter on magento 2 collection like below query?

THis is my core Mysql query select * from table_name where CONCAT(',', subscriptions, ',') like '%,4793,%' and i want to apply below filter on magento 2 collection. where CONCAT(',', subscriptions, '...
2 votes
1 answer
19 views

Syntax error or access violation: 1071 Specified key was too long when running setup:upgrade

I get the following syntax error when running setup:upgrade after the update of a specific module through composer: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; ...
1 vote
1 answer
34 views

What is the foreign key relationships in database to connect sales_order with each sale_order_Item?

Foreach customer, I need to retrieve every order. Foreach order, I need to retrieve each product item. The tables are sales_order and sale_order_Item, but I don't see a connection. How are these ...
0 votes
0 answers
25 views

How to select all products that have the same manufacturer

I am trying to do a select query where the results will be on column the manufacturers and the other the total price of items sold by that specific manufacturer. I have managed to create two separate ...
1 vote
0 answers
12 views

There is already an account 2.4.4

I'm having following issue that i'm not able to reproduce https://ibb.co/0M1mvQ6 I checked in system.log but i don't have any critical warning. I made also a registration with a different email ...
1 vote
0 answers
20 views

how to add product comments in product display page and save in database?

I want to add product comment options in PDP and save that in database and pull back and show that in shopping cart page. How can I do it?
0 votes
1 answer
31 views

Add all products to a new category 2.4.4

In my magento 2.4.4 version i just created a new category. I need to assign all products to this new category. So keep the product to their current category but in addition assign to this new one ...
1 vote
1 answer
18 views

Custom mysql triggers deleted automatically in Magento 2.4.2

I am trying to create a custom mysql triggers for a custom Magento 2 table by using Setup/UpgradeSchema.php file. Problem: For the first time triggers are created correctly. But next time when I ran ...
1 vote
1 answer
20 views

How to add custom attribute in PDP and save that in database?

How to add a custom attribute in Product Detail page and save it's value in quote table after the add to cart is clicked?
0 votes
1 answer
14 views

Mysql query to external db from Magento with mysqli

I have a problem executing mysqli from magento. I need it to query an external db and retrive tracking information. I added this code to a php plugin file: $conn = new mysqli($db_server, $db_user, $...
0 votes
1 answer
21 views

mysql command to delete something from the setup_module table?

This should be a pretty easy question for most but i'm pretty bad with mysql. I did a select and i see that i need to remove a module schema version and data version but i don't know the exact delete ...
1 vote
2 answers
100 views

Magento and MySQL: Access denied for user 'username'@'localhost' (using password: YES)

I am setting up an existing Magento site to run locally. The site uses MySQL, which I have installed and running on MacOS. I created a user doing the following: > $ mysql -u root CREATE USER '...
0 votes
1 answer
24 views

How to change the value "is_required" in the table eav_attribute in the entity_type_id "2" and with the attribute_code "lastname" programmatically

Good day people, I have been trying to change the value is_required in the table eav_attribute in the entity_type_id 2 and with the attribute_code lastname in Magento 2 but without success, this is ...
0 votes
1 answer
33 views

How to make id field auto increment in db_schema.xml in mageno 2.4?

I have a custom table created through db_schema.xml (code below): <?xml version="1.0"?> <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
  • 7
1 vote
0 answers
24 views

ShipStation Shipping Label creation is not working Magento 2.4.2

We upgrade the Magento 2.2 to 2.4.2 . We have configure the ShipStation as shipping. But we are not able to create shipping label. We are stuck in Add to products to packege popup. Save button doing ...
  • 11
0 votes
1 answer
50 views

Magento 2 - can't add foreign key constraint with declarative schema (db_schema.xml) - Reference column X in reference table Y do not have index

I try to add this table: MODULE/etc/db_schema.xml: <?xml version="1.0"?> <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="...
  • 2,551
0 votes
4 answers
99 views

Magento 2 "PathInfoProcessor\Proxy” does not exist

My PHP version: 7.4.29 I am run this command on window 10 php bin/magento setup:install --base-url="http://mat.magento.com/" --db-host="localhost" --db-name="magento2" --...
  • 342
0 votes
1 answer
28 views

how to create aws instance and setup magento 2

I want to use aws EC2 service and RDS for database and going to setup magento 2 project using gitLab so anyone have idea then please share with me. Thanks in advance.
  • 507
0 votes
1 answer
33 views

Magento 2 - Get product attributes selected value via MySQL

I am trying to get a products selected attribute value via MySQL. Basically, what I need is the SQL equivalent of this: $_product->getResource()->getAttribute('my_attribute')->getFrontend()-&...
  • 486
0 votes
0 answers
16 views

Choosing wrong mysql strategy for Catalog Price Rule Select statment

I am experiencing a bizarre issue to which I can't really wrap my head around, maybe someone here has faced a similar issue and has a fix or an idea. We are using Magento 2.3.5-p1, with a catalog from ...
0 votes
1 answer
142 views

Fastest way to get attribute value of custom product attribute by attribute_code and sku

Hello fellow Magento developers, What is the most efficient way of getting an attribute value of a custom eav product attribute, by only using its attribute_code and the products sku? => The ...
  • 33
0 votes
0 answers
32 views

SQL Queries not executing

As the title says, I am running a few queries on a Magento 2 DB, but they never execute. When I run the queries on the server, the DB disk gets full and the queries don't stop loading, but when I run ...
0 votes
0 answers
48 views

Error during upgrade: Types binary is not declared in Magento 2

This error happens because of Fishpig Wordpress extension's solved => I'm getting following error "Cannot process definition to array for type tinytext" on Magento 2.3 when executing php ...
  • 2,212
1 vote
1 answer
23 views

Can you see which user handled/proces which customer order?

Is it possible to see which user completed a customer order?
0 votes
1 answer
40 views

Using Magento 2 backend on multiple computers

We can work in the backend on multiple computers, but the system sees it as 1 user working. Case explanation: For example, if I am working on an particular customer order in the sales environment, ...
0 votes
0 answers
12 views

Urgent issue: Communication link failure: 1153 Got a packet bigger than 'max_allowed_packet

Everytime I get: [2022-06-28 09:58:23] main.CRITICAL: SQLSTATE[08S01]: Communication link failure: 1153 Got a packet bigger than 'max_allowed_packet' bytes, query was: SELECT COUNT(DISTINCT e....
  • 2,106
0 votes
1 answer
33 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 ...
0 votes
1 answer
19 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 ...
0 votes
1 answer
23 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 ...
0 votes
1 answer
21 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 ...
1 vote
2 answers
185 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 ...
  • 98
0 votes
0 answers
22 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 ...
  • 53
0 votes
1 answer
91 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 ...
  • 1
0 votes
2 answers
51 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!
1 vote
1 answer
193 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 ...
0 votes
0 answers
96 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 ...
0 votes
1 answer
11 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 ...
1 vote
2 answers
39 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. ...
0 votes
0 answers
68 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 ...
0 votes
1 answer
49 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 ...
0 votes
1 answer
80 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 ...
  • 181
0 votes
2 answers
232 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-...
  • 2,551

1
2 3 4 5
64