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

Bulk updating product prices : Magento 2

In my M2 store I have over 200k products. They were added manually through API (https://domain.com/rest/all/V1/products call). Nowadays prices of my products are changing frequently and I need to ...
1
vote
2answers
1k views

How to import products from another database into magento2's database

I have an ERP system with a database that holds more or less 400,000 items. I need the 400,000 items to be migrated to my Magento 2.1.3 database. Is it possible to directly import items from my ERP ...
0
votes
4answers
2k views

Direct sql query in magento not working

I am facing strange problem, when I use direct SQL query method in Magento controller its not working $resource = Mage::getSingleton('core/resource'); $connection = $resource->...
0
votes
1answer
22 views

Certs-Buzz and Magento Certified Developer Exam Training Material

I'm attempting to take the test for the Magento Certified Developer. I wonder if the appropriate responses given to each address are dependable? Since when I resulted in these present ...
14
votes
5answers
21k views

Magento MySQL Has Gone Away Error

I'm having loads of weird issues on Magento CE 1.7.0.2. During normal operations, the site will occasionally produce a Magento Error Page (There has been an error processing your request) on both ...
1
vote
1answer
17 views

How to programmatically set description in simple associated products?

I need set description in all associated products of specific configurable product and with this code all it's ok except part of code where I insert description in associated products on database. ...
0
votes
2answers
33 views

Why product collection model don't show real Sql query?

I want to understand how M2 loads products EAV attributes, so I wrote the following code: $productCollection = $this->productCollection->addFilter('entity_id', 7) ->...
1
vote
2answers
984 views

Custom Attribute is not saving data in database

I'm trying to add custom text box named cashback in Magento 2 product add/edit page. I added the text box programmatically. But my below code doesn't add column in the table also not saving the value. ...
0
votes
1answer
29 views

Magento 2.2 - MySql slow Queries issue

I am new in Magento 2.2 and facing MySql slow queries issue.I want to know how to use/install MySqltuner in Magento 2. And where is the location of my.cnf file? Need help to fix this issue. Thanks
1
vote
0answers
28 views

Magento 2 Catalog search results are not correct?

I have migrated data from magento 1 to magento 2. I am searching product name: 4.0ct Round Morganite Diamond Engagement Ring Bridal Set 14k White Gold then it is showing lots of products on result ...
2
votes
2answers
2k views

Do you enable query_cache for Magento?

All tutorials for optimizing Magento performance I read suggest that we should enable query cache in mysql -> my.cnf However, I read a lot of other articles and even the mysqltuner script also ...
2
votes
2answers
1k views

Magento 2: How many products sold Query

For Product A have 100 qty., For Product B i have 200 qty. I would like to check how many products ordered for a particular product. Which table i need to look up & what will be the query to get ...
2
votes
1answer
656 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 ...
2
votes
1answer
89 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 ...
2
votes
0answers
33 views

Magento 2.3.2 : How to clear magento database after testing

I am currently doing a lot of tests in Magento so I can get familiar with it. Unfortunately the database is extremely cluttered with my tests. I wish to clear up the database so I can start over again....
0
votes
1answer
21 views

Magento 1 sub domain Redirect issue

Just copy original domain files and DATABASE to Sub-domain and change Base-URL every links is working prefect but only few products, category, and images slide show links redirect to original main ...
0
votes
0answers
22 views

Magento 2.3.1 Frontend stock not correct after sql update

I'm updating stock via SQL update along the lines of below website https://www.danjoseph.me/2017/01/12/magento-2-database-level-inventory-management/ The price and qty is updated and visible in ...
1
vote
2answers
34 views

Magento 2: SQL get orders with specific option id

I'm trying to get all orders with a specific option id to see what percentage of orders are ordered with measurement of centimeters. Not very good with database queries and I can't seem to figure it ...
0
votes
1answer
331 views

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'productinquiry' already exists

I have uploaded one of my projects in the server which is in magento 1.9. I have changed the base_url all details in the database. But there is an error, the error is shown below : Exception during ...
0
votes
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 ...
3
votes
2answers
658 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
1answer
458 views

How to Import Products, Categories and Custom Attributes from database?

As the question says. I want to import products, categories and custom attributes on database level. What tables do I need to take with me? For the curious among you: The reason is that I had a ...
2
votes
2answers
713 views

Flush DDL Cache

I created an update script to create some new fields in the database for my custom model. When I am trying to save the model the new fields are not being saved. I thing Magento caches the DDL ...
1
vote
1answer
36 views

Magento 2 load dynamic values to select field in XML

i am new in Magento development. I am trying to create a new module for adding dynamic fields for product edit page. Now I was able to add the fields in admin's product edit page. now I want to show ...
2
votes
1answer
53 views

Magento 1.9 Mysql Query to pull out data

I am kind of stuck getting data from magento 1.9. The solution i needed is mysql query so that I can collect all data in one table. The values in table i needed from different table are product id, ...
0
votes
0answers
39 views

Using Magento 2.3.2 with MySQL 8.0: Which problems could arise?

According to the DevDocs only MySQL 5.6 and 5.7 is supported. I have set up a shop now with MySQL 8.0 and it seems to work so far. However, it is not a fresh installation, instead I dumped the ...
0
votes
1answer
89 views

Magento 2.3: Delete Product Attribute SET and Delete all categories through Database Query

I want to delete all custom attribute sets, I'm facing an issue when I'm deleting attribute set manually then 404 error is showing in Magento 2.3 and can i delete all categories with 1 database query ...
0
votes
0answers
33 views

Magento 2 : Create a module for hiding custom options of a product when checked using checkbox

To create a module for magento that adds a checkbox for the values rows in the “Customizable Options” section on the product page in magento backend. This checkbox will hide the customizable option ...
0
votes
1answer
23 views

Auto Cron is Not Working When I want to add Data into DataBase

Here Data Was Successfully Addded Into Database When i Run php bin\magento cron:run Command But AutoMatically Data Wasn't Added. vendor\module_name\Cron\Test.php use Psr\Log\LoggerInterface; class ...
0
votes
0answers
18 views

Database Resources setup in local.xml + magento1.9

I want to setup default_setup and default_read as different databases for both in Magento 1.9. Now the thing is there is something wrong with default_setup DB but default_read DB is proper so homepage ...
1
vote
1answer
39 views

Magento 2.2.2 to Magento 2.3.2 - setup:upgrade error

After being able to update magento to 2.3.2 Which is in current state when I try to run the command bin/magento setup:upgrade: get the below error root@---:/var/www/html# bin/magento setup:upgrade ...
0
votes
2answers
40 views

Magento 2.3: get latest post from table

I have a simple post table, how can I get lasted post in the phtml file.
0
votes
0answers
34 views

Magento 2 custom catalog condition rule not saving in custom module

I have added custom catalog conditions to my custom module admin form. a condition drop-down is displayed fine and in post data, condition value is also getting. but I am unable to save condition ...
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 ...
5
votes
2answers
694 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
0answers
29 views

Products with tier prices cannot be updated

I run magento 2.3.0 and have the following problem. I have several configurable products in magento store. Under the configurable products i have created simple products with tier prices. When i ...
0
votes
0answers
12 views

How to restore images of deleted products via sql?

I am using magento 2.2 version , I was deleting few products from admin dashboard , at the time of deleting my site crashed due to server issue and because of that when site goes up I see that 8 ...
3
votes
4answers
2k views

Set default values in Install Schema

I want to create a table with one default row. i.e. I have two attributes. How to create table with (1,1) entry by default using Install Schema?
0
votes
1answer
49 views

InstallSchema not running even though module is not installed

I searched all over and don't see anyone with the same issue. Below are steps I tried to solve this with no success I deleted the module from setup_module table. I don't see any errors in var/log/...
1
vote
0answers
26 views

EAV load collection issue (High Load Time)

We have an eCommerce platform. The issue is that when we increased the products to ~3000, the EAV:load_collection is taking a lot of time(~20 sec) and eventually slowing the site. If I remove the ...
0
votes
2answers
720 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
23 views

DB Error SQLSTATE[42S02]

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mavikmarine_l2li.m_catalog_product_flat_1_tmp_indexer' doesn't exist, query was: UPDATE m_catalog_product_flat_1_tmp_indexer AS et ...
0
votes
0answers
14 views

Slow Query magento 2 Product page

I am debugging magento 2.3.1 before releasing it to production and I find that some products respond slowly and others make it faster. (then I will update it to 2.3.2) In particular I have a query ...
0
votes
2answers
132 views

Error Array to string conversion in vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on line 3101

When i tried to edit an image in custom module i am getting an error like below. 1 exception(s): Exception #0 (Exception): Notice: Array to string conversion in /var/www/html/vendor/magento/...
2
votes
2answers
486 views

Magento 2 Down: replica Tales not found when reindexing!

My server went down because the disk was full, after fixing it, I noticed that the magento 2 website never came back: (Magento 2.2.4, PHP 7.0.30) When re-indexing, i get the following error: ...
0
votes
1answer
767 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 (...
0
votes
2answers
37 views

How to truncate database table using n98-magerun2?

I am trying to truncate the database table using n98-magerun2 version 3.2.0 and having some difficulties. I know there is a command with option to run an SQL query: db:query Executes an SQL query ...
2
votes
2answers
644 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
2answers
653 views

Magento 1 custom Model, Can't get data from table

I created my own module, the table is created in the database and in a phtml I can call: $res = $model->getExample(); and effectively it function is called. In Model: protected function ...
0
votes
2answers
53 views

Magento 2 - How to truncate table using SSH?

I want to truncate database tables using command line. Any directions will be highly appreciated.