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
2answers
25 views

How to add tables to database with foreign key?

I'm trying to extend costumers to add some wholesale info we need, so I'm trying to create a module with an InstallSchema to create, let's say, the table 'wholesale_info' with some columns and getting ...
0
votes
0answers
17 views

Foreign key checks not working while running datapatch

I've created this datapatch to migrate some attributes (width, height, depth) from a varchar attribute to the decimal counterpart. Since both have been in de database for a long time I have to account ...
0
votes
1answer
101 views

Inventory View inventory_stock_1 causing database locks

After moving databases we are getting spikes in our database from PDP pages with the following query, and it ends up taking a full minute to query. SELECT `inventory_stock_1`.`quantity`, `...
0
votes
0answers
25 views

Filter product collection with nested OR/AND statements

I want to make a query as below WHERE manageStock = 0 OR (manageStock = 1 AND productStatus != 0) OR (manageStock = 1 AND backorderStatus = 1) but I can't use $collection->getSelect()->where() ...
0
votes
0answers
26 views

Internal Server Error

I just hosted on Godaddy, and i downleded magento 2.3.6 from magento official site and i uploaded it into filemanager, when i run the URL, it is showing 500 error. Can you please guys help me this. ...
1
vote
1answer
70 views

Upgrade Magento 2.3 and store code base is not found

I upgraded my Magento 2.3.1 to 2.3.6, I'm seeing this message in the frontend. The website with code base that was requested wasn't found. Verify the website and try again. How could I fix it?
1
vote
0answers
234 views

Reindex process hangs and blocks website

I have a problem in my Magento 2 (version 2.3.4) shop that reindex process sometimes runs indefinitely and brings the whole site down (502 nginx error or timeouts). I noticed on the DB level, that in ...
0
votes
1answer
28 views

Magento 2.3 localhost Blank page Frontend and admin

I'm trying to transfer my test site from web space to local (I'm running low on maximun allowed size) I've downloaded my database and a copy of the site. Through Xampp I've imported the database, I've ...
0
votes
1answer
72 views

Magento2 custom sql to get data from external table and import into product

In Magento2 I am trying to connect to an external database and table and use the data to update a custom product attribute where the sku' match in both tables. I temporarily put this code in my footer....
0
votes
1answer
20 views

Can not display all column from a table

I have a table name my_cars. There are 4 column in my table. I create collection, model, recourse model,controller and block. And i can display data from my table. But all column of data not ...
0
votes
1answer
284 views

How to get checkbox value and save it on database

I have added a custom checkbox in checkout page, and I have added a custom column to sales_order and sales_order_grid tables, now I want to get the value of my checkbox and save it in my custom ...
0
votes
1answer
125 views

Magento 2.4.0 Installation Error

I am getting this error in during installation of Magento 2.4.0 on Live server. Please help if you can. Current version of RDBMS is not supported. Used Version: 5.6.49-cll-lve. Su pported versions: ...
0
votes
2answers
46 views

How to get All product data from magento 1.9 database

I want to gather all my product from magento 1.9 database and upload on other site of magento 1.9 any one know how to do that ? Thanks
0
votes
0answers
311 views

Magento 2.4 - Port must be configured within host parameter Pls Help

I can start the setup via Command Line. And I get no Errors. But if i enter the homepage i got this error: [2020-11-03 23:11:17] main.CRITICAL: Port must be configured within host parameter (like ...
0
votes
0answers
14 views

where prepared query to base can see

For example my repository get items by getList($searchCriteria) where I can see prepared query to base like this SELECT * FROM table. I am use xdebug so I need a line of breakpoint or name of function....
0
votes
0answers
11 views

Collection join to diffrent databases table

My Magento project has 2 connetions: default,whmanager. $joinConditions = 'main_table.product_id = catalog_product_entity.entity_id'; $collection->getSelect()->join( ['...
0
votes
0answers
93 views

Magento 2.4 Docker - Port must be configured within host parameter

I can start the setup via Command Line. And I get no Errors. But if i enter the homepage i got this error: [2020-11-03 23:11:17] main.CRITICAL: Port must be configured within host parameter (like ...
0
votes
0answers
21 views

Filter and sorting not working in custom culumn in upsell_product_listing.xml

I have joined column qty to Magento\Catalog\Model\ResourceModel\Product\Collection But Sorting filter by qty not working and sorting too in upsell_product_listing /app/code/Vendor/UpsellProducts/etc/...
0
votes
1answer
117 views

How to fix skip to content option in magento 2

I have issue with the magento2. When we open a website the skip to content appear before loading the complete website . How i remove this option. Image is atatched.
1
vote
0answers
44 views

The stock item was unable to be saved. Please try again. Magento 2.4.0

I installed magento 2.4.0 on my Linux server from godaddy. I'm unable to add the products to it. It is showing the Error is The stock item was unable to be saved. Please try again. Can any one help me ...
1
vote
0answers
130 views

Invalid entity_type specified: catalog_category magento 2?

I created a custom column using my custom module after that I removed that custom column manually from table mg_catalog_category_flat_store_1 magento 2 phpmyadmin after that this error accur in ...
0
votes
0answers
124 views

Magento 2 search 3 characters with hyphen not working

Magento 2 search 3 characters with hyphen not working Example - product SKU is 4-e - it gives lots of search results instead of related to 4-e results(not giving related with 4-e) there is no ...
0
votes
0answers
99 views

I have slow mySQL queries causing very slow backend when we do changes or editing

this can be confirmed from the following snippet, showing slow queries that are taking almost 3 seconds to run: | 1105858 | handyimp2_handydb | localhost | handyimp2_usrhand2 | Query | 3 | Creating ...
0
votes
0answers
34 views

Get data from DB (load method) Magento 2

I have controller, template, view. I need using load method, but i don`t know how i do that $post = $this->collectionFactory->create(); $this->collectionFactory->load($post, '...
1
vote
0answers
210 views

Magento 2.3 crashing on never-ending search_tmp_* queries

I'm using Magento 2.3.2 and a production site that has a decently large number of products. The site has been running fine for over a year but in the last week we suddenly have an issue where a ...
0
votes
1answer
23 views

Magento2.4 mysql to make all products a product type of simple

I imported all products into Magento2.4 using a plugin and just noticed 100 or so products have no product type which is causing them not to show on the website. How can I run a query on the database ...
0
votes
1answer
20 views

Magento 2 Image Gallery pure SQL Manipulation

I've written an interface for Magento 2 admin that allows creation and editing of key product attributes from a phone. Once a product is created and it's images attached to the product, I have been ...
0
votes
0answers
15 views

from host to another

i have magento 2.3 i restored databse and copy all file in directory of server 1 to server 2 change the name and username and password for database from env.php remove all file from var/...
3
votes
0answers
96 views

Using --no-tablespace option when backing up Magento 2 databases

I run a nightly cron job to back-up to backup my SQL databases using mysqldump. This has started to display the following error on all my databases: Error: 'Access denied; you need (at least one of) ...
0
votes
0answers
231 views

main.WARNING: Memory size allocated for the temporary table is more > than 20% of innodb_buffer_pool_size. Strange values

I'm receiving the following alert from Magento2: main.WARNING: Memory size allocated for the temporary table is more than 20% of innodb_buffer_pool_size. Please update innodb_buffer_pool_size or ...
0
votes
1answer
29 views

Magenot 2 SQLSTATE[42S02]: Base table or view not found: 1146 Table 'databasename.sales_order' doesn't exist

I'm getting an error when I navigate to the order grid section of the magento 2.3.4 under Sales -> Orders in the admin panel. It appears to be referencing the wrong table because table '...
1
vote
1answer
58 views

How to clean up all the Product Recommendation logs?

How to clean up all the register that I have in my database related to the Product Recommendation logs? Is it something that I can do from my side?
0
votes
3answers
467 views

Magento 2 - Check if record with certain value already exist in table before creating it

I created a new table company_shipping_quote. I am writing data into it like this: $quoteId = $quote->getId(); $html = $this->_generateNote($expressRule); $quoteModel = $this->...
0
votes
2answers
48 views

Magento 2 - Created new table and model - but model does not save!

I created a new table company_shipping_quote and new models by using https://mage2gen.com/. But how can I create a new object and save it so that it appears in the database? Models: Company/Shipping/...
0
votes
0answers
11 views

Magento 2.4.1: how to a separate and reuse a large database for products and categories from M2.4 shop db

any idea of how can I have products and categories in M 2.4.1 community in a separate database from the actual shop and reuse products and categories in for a new M 2.4? The database I need to share ...
1
vote
1answer
174 views

Magento 2 Admin - Product Cannot Add or Edit

I just upgrade Magento 2.3.0 to Magento 2.3.5, But after installation In Admin > Catalog > Products I cannot edit or Add new products, When I am trying to add or edit Product Page then getting ...
0
votes
1answer
73 views

Remove trailing and first space from sku

I have Magento 2.2.2. Some SKU products contain a trailing space. How to using data patch or MySQL database query which will remove all leading and trailing spaces from SKU products.
3
votes
2answers
890 views

Magento 2 not spawning consumer processes i DB (RabbitMQ)

I have setup Magento 2.4 with RabbitMQ. You can see my configuration here. 'queue' => [ 'amqp' => [ 'host' => 'rabbitmq.host', 'port' => '53003', 'user' => '...
0
votes
0answers
13 views

Add boolean value of false/0 where order exists in sales_order but not custom table

The code below I am adding my custom column to the sales_order_grid table. The problem is it only adds the values where order_id in my custom table exists. How can I add the value of false or 0 to ...
0
votes
0answers
45 views

Magento 2 How to get layered navigation filter based on category id

I want to get category filters and its values when I send category id to rest Api But in my case I am getting errors please see the below screenshot and code as well. Thanks in advance. protected $...
0
votes
1answer
32 views

How to have a CSV with customer, order and shipping information since a date?

I'm running a Magento Commerce Cloud B2B, and I need to get a CSV list of these data below, the most important data to me is the client's phone number which is inside the shipping information since a ...
0
votes
0answers
9 views

SQL query to report 1:N EAV attributes

I'm building a query to extract a report of products and relative authors. For Each SKU I can select n authors, authors attribute ID is 151. This query returns comma separated values for ed.value ...
0
votes
0answers
93 views

Get Attribute Customer in Magento2 with GraphQL

I created new attributes for customer but I want to insert them into a structure in graphql. Where there is an array called Garage with the new attributes. It is already being displayed normally in ...
0
votes
2answers
322 views

Getting SQLSTATE[HY000] [2002] Connection refused when running upgrade command for Magento 2.3

I am getting the following error when running the php bin/magento setup:upgrade command in my Magento 2.3 instance: SQLSTATE[HY000] [2002] Connection refused I can connect to the database using the ...
0
votes
1answer
32 views

Elasticsearch installation and MySQL RDS

I have elasticsearch installed in the same Magento 2.4 instant, but my MySQLdatabase is on AWS RDS, How should I configure elasticsearch?
0
votes
0answers
35 views

Optimize grid collection for huge data set Magento 2

I am working on creating an admin grid for sales_order_item table. There are probably a hundred million rows in the database and when I use the collection to filter and load data into the grid, it ...
0
votes
2answers
570 views

Invalid column data type when reindex Magento 2

I'm using Magento 2.3.4 for my website, when I try to reindex, the category flat was not reindex and appear error like this: I search some post in here and try this solution: magento 2.3.4 ...
0
votes
1answer
26 views

What's the purpose of the mview_state table in the database?

I saw the numbers increasing in the mview_state table in the database and there is no cleanup. So I wonder what's the purpose of this table and the values that we have there?
1
vote
1answer
27 views

Installation Error - Magento 2.4

I am installing Magento 2.4 with my (Magento 2.3 Database), but Now I am getting this error, anyone can guide me or give me any solution how to I can fix this issue ? Please check below screenshot. ...
0
votes
1answer
189 views

Magento 2 - change database column type

I need to change the type of the column "value" in the table catalog_product_entity_varchar from varchar(255) to varchar(512), but I find nothing in the documentation about how to do it, so ...

1 2 3
4
5
72