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
2
votes
1answer
850 views

Performance issue - slow query in Magento 2

When I check SHOW PROCESSLIST; in mysql I got below query. It heavily uses CPU (more than 100%). We have a separate server for mysql(64GB RAM). INSERT INTO `search_tmp_598075de5c7e67_73335919` SELECT ...
0
votes
0answers
11 views

Magento 2: How to allow updating a null value for a column having foreign key constraint?

I have 2 tables A and B A id name B id name a_id FK references A(id) I used the Magento's upgrade script to add both tables, everything was created correctly, however when i tried to setting a_id ...
1
vote
1answer
1k views

Magento import tables from old database show error (errno: 150 “Foreign key constraint is incorrectly formed”)

i want to import old customer data to new magento store i have imported all customer's table instead of customer_entity, when i import this table i am getting this error 1005 - Can't create table ...
1
vote
2answers
26 views

QLSTATE[42S02]: Base table or view not found: 1146 Table 'mysite.vgroup_testimonial' doesn't exist, query was: DESCRIBE `vgroup_testimonial`

I have installed an extension for testimonial by V Group Inc. after the installation when i tried to add testimonies, the extension was giving me this error SQLSTATE[42S02]: Base table or view not ...
1
vote
1answer
103 views

Magento 2: Multiple Product Type Not Sorting Due To Amasty Extension

I'm facing a problem due to Amasty Extension. I have a category which has 1 simple product and some configurable products, but when I try to sort them, simple product always comes first although ...
3
votes
2answers
806 views

Magento 2: Adding “updated_at” column does not update current time stamp

I am using Magento 2.2.6 version. Am just trying to add an extra column updated_at in setup/upgradeschema.php. But on saving data, it is not updating the timestamp automatically. It is null always. ...
1
vote
2answers
16 views

2.3.3: Moving to an updated version of a website

I need to move from my old version of my site to my new one. I have imported all the orders although I did this manually as the products structures completely changed. I would like to know a reliable ...
0
votes
2answers
22 views

How to use one database for each store or website?

Let's suppose that I will create an e-commerce for a restaurant chain that has several restaurants and in each restaurant the menu is a little different. The user will enter the website and input its ...
0
votes
1answer
24 views

How to assign guest orders to registered customers by email via SQL?

I'm using this SQL below to manually assign guest orders to registered users. UPDATE sales_order SET customer_id = {YOUR CUSTOMER ID}, customer_is_guest = 0 where entity_id = {YOUR ORDER ID}; UPDATE ...
0
votes
1answer
15 views

Product QTY update Slow

Long time reader, first time asking... Not sure if this a magento issue or other. I use Firebear import/export tool to update the stock qty, approximately 105,000 SKU's. Worked fantastic for about ...
0
votes
0answers
5 views

how can i move the product tab section to the below of the product gallery with 50% width in magento 2

how can i move the product tab section to the left of the gallery section with the width 50% which is now having 100% width in magento 2.3.3 please help
2
votes
2answers
77 views

Magento 2: How to dump database from Magento cloud

How to dump the database to local system from Magento Cloud server with Magento 2 Commerce. I have only access to the ssh but that ssh user doesn't have write permission into the server. So by any how ...
1
vote
2answers
290 views

Magento 2.3 introduced a view table which causes issue with import of mysql dump. What's it for?

If you mysql dump a magento 2.3 store and try to import it elsewhere you get an issue due the the format of the view import query. The problem part is this: CREATE ALGORITHM=UNDEFINED DEFINER=`...
0
votes
1answer
14 views

magento 2.1.5 unable to add product getting mysql error

i am getting below error while adding product in magento 2.1.5 SELECT `e`.* FROM `catalog_category_entity` AS `e` WHERE (()) 2 exception(s): Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[...
7
votes
2answers
9k views

Magento 2: Where is cart data saved?

Magento version: 2.0.0 When user add products into cart, where are they saved? $_SESSION or Database? If it is in database, which table?
0
votes
0answers
15 views

how to get unique id from custom database table in magento 1 for pushing that id into google analytics

I have created a custom table in magento 1.9 now I want to get the unique id from database, how can I get the unique id from magento database. Here is the code <?php if(Mage::getModel('surgery/...
0
votes
0answers
21 views

Changing the CopyRight Notification Year from 2019 to 2020 in Magento 1.9

I tried out Admin -> System -> Configuration -> Design (left menu) -> Footer -> Copyright but it is not changing the Year from 2019 to 2020....Any correct solution ...Reply back to this Question as ...
3
votes
4answers
17k views

Magento 2: How to insert data into custom table in model file?

Magento version: 2.0 I created a table to store some data. but maybe I have to use many file to do it from some tutorials, such as model, resource and collection folder's files. I just save, update ...
1
vote
2answers
994 views

Problem Sessions Database - Magento 2

Today I saw my Magento database and in a few months, it went from a weight of 300MB to 2GB. I saw which of the tables was heavier and I saw that there is a 2GB SESSION table. Why do the sessions are ...
0
votes
0answers
16 views

catalogrule_product_price Table Gets Deleted From Our DB After Running Rapidflow Job

I'm not sure if this had happened to anyone before but our website uses Rapidflow extension and we had a cron job running at night for Products and Products Extra data type. We usually had the job run ...
0
votes
2answers
807 views

Magento 2.2 : MySQL General error 1787 when reindexing

How to fix the two errors below ? $ php bin/magento indexer:reindex Design Config Grid index has been rebuilt successfully in 00:00:00 Customer Grid index is locked by another reindex process. ...
0
votes
0answers
16 views

Can Magento2 work properly with Azure Managed MySQL?

I have been attempting to get Magento2 to work in Azure for awhile now. There are some issues I'm running into that make me think that magento can't run in an Azure managed MySQL: No support for ...
0
votes
1answer
1k views

Magento : How to Implement Automatic Related Products and Category Based Upsell Products

We have 5000 products at our webstore. We can not use magento default feature related products & upsell, cross-sell products. Is there any customize code or modules which can implement to display ...
25
votes
4answers
25k views

Why and when to use “ Flat Catalog”?

While doing bit research for speed issue of magento website i got some links where people says enable "Flat Catalog" to increase performance and speed . Issue is that why it is not enabled by default ...
1
vote
0answers
17 views

How to add several input fields per entry - admin form in Magento2? [closed]

I want to be able to edit one poll and it's answers in one admin form, and have one input field per answer. I already have my collections ready, how can I create a working admin form ? POLLS TABLE ...
5
votes
2answers
785 views

Magento MySQL Engine choice

Some of the tables in the Magento 2.1 DB have "MEMORY" as their engine. This is a problem for the DB cluster we are using (Percona-XtraDB-Cluster with pxc_strict_mode = ENFORCING). Can I change the ...
0
votes
1answer
24 views

how to switch between mariadb and mysql

my magento2 is reading mariadb server and database is connected to that, I am trying o use mysql instead but I had no luck, it does not recognize the database at all although I have added the ...
0
votes
0answers
26 views

Missing group price after migration M2

After migration From Magento1 to Magento2 Group Product Price Missing I have followed below step Not solve this issue plz help me Step 1 Run query in M1 DB and download resule csv file (without ...
1
vote
0answers
23 views

Joined tables in admin form

I have two tables, one for a list of poll questions and another for the answers to a specific poll. I want to be able to display the list of questions in a grid, then save the question and the answers ...
1
vote
3answers
62 views

Migration in live server

here I am again seeking for help. I've been stuck for 2 days working about this. when I'm working on localhost my website is working. Well, after migration from localhost to my web server it gives ...
0
votes
1answer
18 views

When trying to upgrade I encounter the error “Cannot process definition to array for type time”

I'm getting the following error on Magento 2.3.2 when executing command: php bin/magento setup:upgrade Cannot process definition to array for type time I'm aware that this is usually caused by a ...
1
vote
1answer
39 views

What tables contain customers + products information?

after a data migration problem (please check language translation and migration if interested on issue) I thought on alternatives. a) Export csv with products + clients and reimport on clean install. ...
1
vote
1answer
15 views

how to change default sort by price to custom attribute like gtin in magento 2

i have already tried to make the chanage of sort by price to custom attribute in admin store configuration but still the products are sorting by price in magento 2
0
votes
0answers
17 views

Wrong with processing the default view and we have restored the filter to its original state

Anyone can help me regarding this issue? why this error is occurring in Magento 2.3.0. I transferred my website from localhost to live server, On the live server, I'm facing this issue in under ...
0
votes
1answer
25 views

How to get the values from different rows and same table in mageno2

I want to get filter_options(804) value based on the condition filter_ids=13 and filter_ids=7 and filter_options=575 for the same sku. How to do that. Thanks.
0
votes
2answers
654 views

Parse error: syntax error, unexpected '$servername' (T_VARIABLE), expecting function (T_FUNCTION) or const (T_CONST) php

I am trying to connect to a MySQL database usign PHP but am currently facing this error : Parse error: syntax error, unexpected '$servername' (T_VARIABLE), expecting function (T_FUNCTION) or const (...
0
votes
0answers
22 views

Database import Error in Migration Magento 1.9 Store

I am migrating a Magento 1.9 store to another hosting. While I am importing previous database to new phpmyadmin I am getting below error.
0
votes
0answers
15 views

Magento 2 usage of UNION in a custom query?

I am working on a module to remove images of all deleted products, which is not the standard M2 behavior. My initial query to found images path still used by products was : $connection = $this->...
0
votes
0answers
17 views

Magento 1.9.2.2: Restore newsletter subscribers only from db backup

I managed to delete all my newsletter subscribers, but I have a magento db backup. Is it possible to restore the newsletter subscribers only (incl. all their info - password, registration date,...) ...
15
votes
4answers
23k views

How to list all disabled products with sql?

I need to list all disabled products by using a MySQL query. I have too many products in my database to be using something like this (creating a collection, loading it and looping over it): http://...
1
vote
2answers
1k views

Upgrade to 1.9.2.2 - Base table or view already exists: 1050 Table 'mage_permission_variable' already exists

I am trying to upgrade to 1.9.2.2 from 1.9.2.1 through Magento Downloader. On the little screen at the bottom I am getting the error message below: Exception during cache and session cleaning: ...
0
votes
0answers
24 views

Add Import Export functionality to my custom grid in Magento 1

I want to add Import and Export functionality for my custom grid records of my custom module. I had created a custom table in the database. I want to add Import and Export functionality using PHP code....
0
votes
0answers
26 views

Rebuild Customer grid index not working - Getting Error

anyone can help me about this issues, i'm getting this error. I'm trying to fix it, But i could not found any solution. {"0":"Notice: Undefined index: PK_CUSTOMER_ENTITY in /vendor/magento/module-...
0
votes
1answer
976 views

facing this issue contains 1 abstract method and must therefore be declared abstract or implement the remaining method

Facing fatal error given as below. Fatal error: Class Sugarcode\Test\Model\Total\Fee contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (...
2
votes
2answers
690 views

How do i insert line breaks in product description with a SQL query

How can I replace (\n) in SQL with a Line Breaks? i want to do it with a SQL query, I want in table: catalog_product_entity_text replace the value with Line Breaks instead of (\n)
0
votes
1answer
36 views

After migration from magento 1 to magento 2 customers giving eror

After migrating data from Magento 1 to Magento 2 When I click on customers in admin area it gives this error {"0":"Type Error occurred when creating object: Magento\Eav\Model\Entity\Attribute\...
0
votes
1answer
26 views

How to export orders by date via SQL?

I'm using a Magento 2.3 instance, how could I export my orders in a CSV file by date range via SQL? I want to have the shippingId, orderId and paymentId included in it.
3
votes
3answers
362 views

Magento 2 - Docker - Data not persisting

I'm currently running Magento 2 on Docker using docker-compose.yml here is the file: version: '3.0' services: web: image: alexcheng/magento2 container_name: magento2 ports: - "80:...
1
vote
0answers
20 views

Single product page have slow loading

When I open the single product URL (open product). I wait 8 seconds or more for the page to load. Responsible for this behavior is the amount of queries that magento is performing. For this I enabled ...
0
votes
1answer
29 views

SQLSTATE[42000]: 1142 TRIGGER command denied for table 'catalog_product_index_price_replica',

Good Day I am very much a novice when it comes to this. I upgraded my store from Magento 2.2.8 to 2.3.3. All seemed initially to go without issues. However on reindexing i get the below error. ...