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

product view count table in database magento 2?

i have write code for get product count.it is working fine but i want to know where the count record comes? public function getProductCount($id) { $prodData = $this->_prodCollection->...
1
vote
3answers
25 views

How to output and filter collection using “->where” filter?

I trying to get output from collection using 'where' filter but no result. This is my code: $collection = Mage::getModel('my_work/datanews') ->getCollection() ->...
3
votes
1answer
1k views

Magento 2 call table stock_item from database

I working to Magento 2.0.2 and i trying to call the table stock_item of the product. When i worked in Magento 1.9 i used this code: loadByProduct($_product)->getQty();?> But now the class Mage is ...
0
votes
2answers
3k views

Get the special price of the product using query in Magento

I want to create a view of Magento products. The following query will do that: Note: Magento's default records used to create it. SELECT P.entity_id as uid, P.created_at as cdate, # Created to ...
0
votes
1answer
583 views

How to get full list of product with Simple Product SKU Number and Category Name from MySql with Query in Magento?

I want to pull data from Mysql with query in magento, I need data in three columns SKU Number, Category name and product Name etc.
0
votes
1answer
22 views

can't edit product in magento 2. redirect to 504 connection error

In magneto 2, after editing product its shows please wait loader and redirect to 504 connection timeout error.
0
votes
2answers
34 views

SQL error when run command line upgrade Magento 2

When I run the following commmand: php bin/magento s:up; It throws the following error: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'admin_magen34.mg7a_sm_products_filter' doesn't ...
2
votes
2answers
967 views

Column not found: 1054 Unknown column 'at_status_default.value'

I'm actually kind of desperate.I tried many times to update my Community Edition from 2.2.1 to 2.2.5, always failing due to what I guess is a database inconsistency.After the update procedure - done ...
16
votes
6answers
35k views

Magento 2 - How to get attribute options value of eav entity?

How can I get the attribute options values of eav entity? I found solution only for magento 1.x but M2 I don't know. M1: $attr = Mage::getResourceModel('eav/entity_attribute_collection')->...
0
votes
1answer
605 views

Magento v. 1.9.2.4 - MYSQL Table core_email_queue still empty after Updates

got a strange Problem here in my Magento Installation. My Cron Job is running with AOE_scheduler - works fine. Cron Job is running. Screenshot: My MYSQL Table is still empty - no e-mails where send ...
3
votes
2answers
2k views

Where does Magento store the PRODUCT_HAS_WEIGHT attribute

For some of our configured products (unfortunately), the PRODUCT_HAS_WEIGHT attribute has not been set to 1. Although, the products all have weight set (as a float), Magento still refuses to provide ...
1
vote
1answer
28 views

InstallSchema.php fails to execute

I've read various posts here but none of them have been helpful. Steps I have taken: Remove My_Module from setup_module in DB Add Setup/InstallSchema.php Clear generated/* directory Clear cache ...
0
votes
1answer
22 views

all product page showing 404 and i could not access admin pages magento 2

I have copied my Magento 2 backup to my new server now I am getting all product page showing 404 and I could not access admin pages magento 2 exception.log main.CRITICAL: Unique constraint ...
1
vote
3answers
3k views

When to truncate the core_session table?

I have roughly 35,500 rows of session data in this table. Is that a lot? Would this cause problems? How much is generally too much? Should i truncate it? It seems to be a problem so I was thinking of ...
0
votes
1answer
1k views

Call to a member function extend() issue

I tried to import my Magento project into my local machine (wamp server), But I was not able to access it, i got the following error: Fatal error: Call to a member function extend() on a non-object ...
2
votes
2answers
674 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 ...
0
votes
1answer
29 views

Error reindex catalog_product_attribute magento 2

After running reindex catalog_product_attribute, I get an error - (General error: 1114 The table 'catalog_product_index_eav_temp' is full, query was: INSERT IGNORE INTO catalog_product_index_eav_temp ...
0
votes
1answer
2k views

Magento export/import category product sort order

I am looking for an easy way to be able to quickly update the product sort order on any category page via export or import. I have looked into several extensions but have been limited due to the issue ...
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 ...
0
votes
3answers
49 views

Assign all the Order to related Customers on database

My website got hacked and all the customers were deleted, but the orders are still here. I imported back the customers by CSV, but the orders are no longer assigned/linked to them. The only commun ...
0
votes
1answer
1k views

How to change category product position in database

I want to change the position value of the category product tab in the category page from 0 to 2. When the newly created product is created, its default position value was 0. This is my progress as ...
22
votes
11answers
28k views

Magento 2 - What is the correct way to change default Order Id?

Magento 2. After fresh install the new Order id will be 100000001, 100000002 and so on. What is the correct way to change that increment id so it would be a higher number? For example 155555552, ...
0
votes
1answer
159 views

How to Export Enabled Simple products sku with mysql query in magento 1.9.2?

I want to export enabled simple products SKU from magento admin export function is not working fine. I have tried to export many times, and it's showing too many extra records. Now i want to try ...
0
votes
0answers
49 views

Magento 2 data migration errors how to solve

We have installed migration tool in the Magento 2.3.1 EE (composer require magento/data-migration-tool:2.3.1 ) would like migrate M1 commerce edition (1.14.3.1) to Magento 2.3.1 EE. When we execute ...
0
votes
1answer
708 views

How to set frontend compilation via the database

How do you set the front-end workflow option via the DB rather than the admin? This is the setting I'm referring to: Stores > Configuration > ADVANCED > Developer > Front-end ...
5
votes
4answers
818 views

SQL to get order items straight from the database?

How do we get a list of order items and their data (name, sku, quantity, price, weight, and dimensions)? Without using Magento's own framework components. The problem is if the order contains 5 ...
3
votes
3answers
2k views

Create coupon code programmatically (in Magento 2.x)

I'm trying to port over tens of thousands of coupons from a custom e-commerce website into Magento 2.0.8 and I'm having a hard time getting it to work. These are simple coupons either fixed $ or % off ...
1
vote
1answer
18 views

How can I fetch value from serialize product_options faster

I am using following query to load data SELECT `main_table`.*, `sales_order_item`.`product_options` FROM `magento_giftcardaccount` AS `main_table` LEFT JOIN `sales_order_item` ON sales_order_item....
0
votes
1answer
581 views

SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'store_id' in where clause is ambiguous

After searching around I still haven't found a solution so I thought I would post it here. Any help would be greatly appreciated. When I go to filter one of the columns it redirects me to dashboard ...
0
votes
0answers
17 views

Magento 2: tmp_catalog_category_entity__sales_order_1 doesn't exist

While running php bin/magento s:up We get the following error: SQLSTATE[42S02]: Base table or view not found: 1146 Table '[DATABASENAME].[PREFIX]tmp_catalog_category_entity__sales_order_1' doesn't ...
0
votes
2answers
76 views

how to update data in database table

I am sending data to the database by checking duplicate data. But I can't be inserting/updating data in the database. protected function saveEntityFinish(array $entityData, $table) { $...
0
votes
2answers
887 views

Magento 2: How to remove Category using category id by Mysql script

I want to remove category using MySql Script So I can delete the category using category ID completely from magento 2 as we did in admin area category section.
1
vote
1answer
24 views

Magento 2 Can't Convert Data Convert From quote_item to order_item Table Using Field-set

Can Anyone Please Help me to data convert quote_item to order_item Table Using Field-set. First I am Create file etc/extension_attributes.xml and use code <?xml version="1.0"?> <config ...
0
votes
2answers
37 views

Magento 2 upgrade 2.1.7 to 2.3.2 give error Foreign key constraint is incorrectly formed modify column customer_group_id in table of customer_group

Can anyone please explain about this type of error Like http://prntscr.com/oow1oz Also, I refer to this link Magento 2 failed database rollback cannot add foreign key constraints but not working for ...
0
votes
0answers
28 views

Magento 2 - Data Migration needs to ignore a custom table

Need to ignore a table from data migration, the table name is "store" where its a default table in Magento 2. Even updated the map.xml to ignore the store table by below code under document_rules ...
2
votes
1answer
689 views

Is it upgrade safe to add custom address attributes

currently, I am developing a Magento extension, that needs to add several custom attributes to the customer address. I've found several tutorials on the topic that describe precisely what I need to ...
0
votes
2answers
1k views

Add a custom field per store view

I need to add a custom field(drop-down list) for a store view, what is the conditional statement I need to display this, it would be nice to have it dynamic and have it added in the admin side. Would ...
1
vote
1answer
4k views

How to add one custom field into register page and get it working?

I have been looking into some tutorials but none of them works, for example, first they told me to open xxx files and edit something but what I found on my files is just a class with no single method ...
0
votes
1answer
29 views

Magento 2.3.1 Search Bar Error - Unknown column 'search_result.score'

Relatively new to Magento. Helped a friend migrate a site from M1 to M2. Using Porto Theme. Search Bar seems to work (does auto querying as you type and makes suggestions) until you hit 'Enter' at ...
0
votes
1answer
2k views

How to execute large sql query in magento?

I want to store huge content in db and my sample text is 16129 characters in length when i tried to execute this query it is showing "error:The requested URL could not be retrieved" in firefox and "no-...
15
votes
1answer
2k views

Create database table from CSV

I am working on a module that requires access to some tabular data provided from an external source. It's only two columns but has roughly 40000 rows. Currently, my module is just parsing the CSV in ...
2
votes
1answer
7k views

How to save form data to multiple tables in database

I have created a form in the admin panel with various fields. Now the fields here doesn't belong to one single table. On the save, I want some values to go into one particular table while others to go ...
8
votes
3answers
3k views

Cron crashes MySQL

After moving to a new server I am getting the MySQL crash [1] issue once a day, which is coming to my email and annoying not to mention potential impact. Any hints on how to debug this issue? ...
2
votes
2answers
521 views

How to enable database logging without modifying the core?

I am afraid that this might be a rhetorical question, but: Is there any other and cleaner way to enable DB logging then modifying the file Varien/Db/Adapter/Pdo/Mysql.php and set $_debug and $...
1
vote
1answer
32 views

How can I update all products names via sql query in magento2?

Hi I have a list of sku's of all products at my store , I want to update all the names of products I have on store via sql query with respect to it's sku . There is a table name : ...
0
votes
1answer
23 views

Magento 2 Product collection AddAttributeToFilter with AND/OR and !findinset and is null

How can i add " AND (at_product_userclass.value IS NULL) OR !FIND_IN_SET('1', at_product_userclass.value)" filter condition using addAttributeToFilter in product collection. Thanks
1
vote
2answers
1k views

SQLSTATE[42S02]: Base table or view not found: 1146

Last night my host experienced what they call "InnoDB engine server is broken". It took awhile but they did a recovery but had some issues with missing tables. I also found out that we didn't have ...
0
votes
0answers
11 views

Add configurable product page pricing to all 'non-visible' associated products?

I want to 'add' the configurable prices that are calculated on product pages to the 'non-visible' associated products of all configurables. I am having to do this for a data migration project. What is ...
0
votes
0answers
16 views

Cannot get autoincrement value, Magento 2

I getting this error inside /var/log/system.log on instalation succesfully finished, but with error. My admin site not function, sample data either: [2019-08-05 16:41:20] main.ERROR: Error: ...