The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
3
votes
5answers
6k views

Get database connection in magento 2

I wish to have code equivalent in Magento 2. The below one is Magento 1 $resource = Mage::getSingleton('core/resource'); $connection = $resource->getConnection('core_read'); I need the above ...
0
votes
1answer
28 views

Our system detected a lock condition in our database

We are getting an issue with the database. Below is the message we are getting from the server. Our system detected a lock condition in your database. Multiple queries were running too long. The ...
0
votes
0answers
21 views

MySQL error 1153 flooding exception.log with always the same entity_id

I am struggling with a strange error in my Magento exception.log at this time. Every few minutes, Magento logs the following weird message: [2019-07-29 08:17:24] main.CRITICAL: SQLSTATE[08S01]: ...
2
votes
2answers
371 views

Save Button Redirecting to Same Admin Form in Magento 2

I am working on a custom module in magneto 2. i am creating an admin form using UI Component, when i click on save button Page redirects to its self Vendor\Module\Block\Adminhtml\ProductSliders\...
0
votes
2answers
657 views

how to solve magento errors as below,

Warning: include_once(/home/archtraders/stationerypoint/includes/src/Mage_Core_functions.php): failed to open stream: No such file or directory in /home/archtraders/stationerypoint/app/Mage.php ...
0
votes
1answer
635 views

Database connectivity issue in Magento 2.1

I am trying to connect to magento database of another system with the following configuration in app/etc/env.php array ( 'host' => '192.168.1.172', 'dbname' => 'datacenter', '...
0
votes
0answers
18 views

Categories not showing in Admin Product Edit Page in magento 2

I deleted all the products and categories via SQL queries (i used this answer https://magento.stackexchange.com/a/283404/73525 ) after i have recreated all i have categories in the ...
0
votes
1answer
639 views

SQL export of products and associated image gallery files

I need to list all product entity_id, SKU and associated images from the value field of catalog_product_entity_media_gallery. I need the output to be CSV based, so all images of each product will be ...
0
votes
1answer
36 views

How to create simple product using direct SQL queries?

I know direct SQL query is not good practice, but I need to insert product using direct SQL query.Also they do not want to use REST API for that.Anyone has SQL queries to create a simple product with ...
0
votes
3answers
775 views

Data Migration error In magento 2 intergrity constraint violation : duplicate entry :1-Migration_Default

Error : SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-Migration_Default' for key 'EAV_ATTRIBUTE_SET_ENTITY_TYPE_ID_ATTRIBUTE_SET_NAME' I reinstall the setup with a fresh ...
1
vote
1answer
829 views

Magento 1 can't connect to database

Please Helpme on this,I have copied a live site to a development environment so I can do some testing. I've followed this tutorial to get everything up and running. When I go to the site is says ...
4
votes
1answer
698 views
0
votes
1answer
711 views

Magento 2: Change DB Name Without affecting core files

I'm running custom script on my Linux Server. I don't want that script to affect my current database. Username/Password/Host will be same. Only DB name is changed. How can I do that without changing ...
0
votes
1answer
65 views

Magento 2 How to add all country regions in database?

I checked directory_country_region in the database there is no region of the United Kingdom, I need all region of United Kingdom. Is Magento provide the sheet of all country regions or from where I ...
0
votes
2answers
2k views

Magento 1.9 MySQL bulk enable products

Trying to enable all products based on category. I have category id = 14. Went into MySQL PHPMyAdmin and fetched all products from that category: SELECT * FROM catalog_category_product where ...
4
votes
4answers
4k views

Mass delete disabled products with SQL

We have about 68 000 disabled products in our database. We need somehow to delete all disabled products from the shop. The normal Magento's delete product process in the admin does not work as it gets ...
0
votes
1answer
633 views

Magento2 - Remove Sample Data using Mysql Script

Did anyone know how to remove the Sample data from Database using Mysql script, I know we can remove using CLI, But i need a script to remove in Database.
4
votes
5answers
9k views

Magento 2: How to get product name by sql query using product ID

I want to access the product names by query database using product ID. How can I achieve it?
0
votes
1answer
665 views

Magento 2 Migration : SQLSTATE[23000]: Integrity constraint violation: 1062

I followed http://devdocs.magento.com/guides/v2.0/migration/bk-migration-guide.html for migration. I am facing issue - SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'customer-...
0
votes
1answer
681 views

How to find and replace product title using sql query

I am having a magento store with English and Arabic language store view. I am having more than 5000 products(both simple & configuable products). All the products starts from Style now i want to ...
0
votes
0answers
22 views

Magento 2 custom module select query doesn't work

I have the following query: SELECT `main_table`.*, `secondTable`.* FROM `table_one` AS `main_table` LEFT JOIN `table_two` AS `secondTable` ON main_table.blog_id = secondTable.blog_id WHERE (...
1
vote
1answer
57 views

Exception Error: Invalid Method on Product Pages in Magento 2

I recently installed the Porto Magento 2 Theme, it works however when a product is clicked on the below error occurs: 1 exception(s): Exception #0 (Magento\Framework\Exception\LocalizedException): ...
4
votes
3answers
8k views

Where is the admin path located in database?

I want to find out where does Magento2 keeps it's admin path in the database? Any suggestions will be appreciated.
2
votes
2answers
48 views

Magento cloud hosted M2 EE site compromised and got malware attack

Today i noticed in my client's magento 2 cloud hosted enterprise edition site is compromised. In footer hacker added some link along with following url: <script src="http://write-cdn.com/...
4
votes
1answer
930 views

Magento 2 : Foreign key constraint is incorrectly formed, ALTER TABLE customer_group

After upgrade from magento 2.1.7 to 2.2.3 and am stuck. I have tried everything. In Pdo.php line 235: SQLSTATE[HY000]: General error: 1025 Error on rename of './zwwnzwzjhe/#sql-1bd1_25f9' to ...
2
votes
1answer
924 views

How to check if value exists in catalog_category_product table Magento

How can I check if the value exists in catalog_category_product table Magento ?
0
votes
2answers
60 views

Magento 2: Undefined variable: installer

I'm too new to Magento: i'm getting an error when setup:upgrade, here is my code: app/code/Adamsmage/Checkoutattribute/Setup/InstallData.php <?php namespace Adamsmage\Checkoutattribute\Setup; use ...
0
votes
1answer
35 views

can we have multiple branch with one database on magento2 cloud?

on Magento cloud when we create a new branch we have to have new database and instance but it is not efficient, we should be able to have different branches using same database, is it possible? I know ...
3
votes
2answers
95 views

using sql queries is good practice in magento 2

using SQL queries is good practice in Magento 2 over ORM which is best one to while customizing 1)Security 2)Speed ORM vs SQL queries which one giving Security and speed while ...
0
votes
1answer
77 views

Integrity constraint violation: 1062 Duplicate entry '3-2-9' for key 'PRIMARY', query was: ALTER TABLE `catalog_category_product_index_tmp`

Integrity constraint violation: 1062 Duplicate entry '3-2-9' for key 'PRIMARY', query was: ALTER TABLE catalog_category_product_index_tmp ADD CONSTRAINT PRIMARY KEY (category_id,product_id,store_id), ...
2
votes
1answer
47 views

Set expiry date and save value in table magento 2?

I want to set expiry date for let say store credit, I have created custom column by installschema in table as: { $table = $setup->getConnection()->addColumn( $setup->...
1
vote
1answer
770 views

Relationship between catalog_product_entity and cataloginventory_stock_item

I am trying to join these 2 tables together to get all the attributes I need from the group of Product Entity tables and join them with the remaining quantity in stock from the Stock Item table. ...
1
vote
3answers
145 views

2.3 to 2.3.1 Upgrade showing sales_order_grid already exists

So far the upgrade went pretty smooth but now I have a few outdated modules and it's asking me to run the setup:upgrade on CLI but I keep getting an SQLSTATE general error: 1813 Tablespace for table '...
0
votes
1answer
747 views

how to import .csv file in defined table in command line?

I need to import.csv file throught windwos command line terminal in defined table. I trying this command : C:\xampp\mysql\bin\mysql -u root -p dbname dbtablename < C:\xampp\htdocs\site\csvfolder\...
2
votes
2answers
2k views

Deprecation Notice - Elasticsearch - Magento 2.3.0

I have installed version 2.3.0 of Magento and I have received this notification: Deprecation Notice Catalog Search is currently configured to use the MySQL engine, which has been deprecated. ...
1
vote
1answer
101 views

Magento 2 is not inserting into “quote_shipping_rate” table?

I have done my homework and I know what the problem is with my website, but I don't know how to solve it The Symptoms When a new user clicks on place order, he receives an empty error message ...
0
votes
0answers
23 views

After upgrade to 2.3 Version order Number is always set to 000000000

After Magento upgrade to 2.3.0 Version I have a problem with the checkout. I get an error Rolled back transaction has not been completed correctly I can see in the database that the increment_id ...
1
vote
0answers
62 views

upgrade issue from 2.1.14 to 2.2 :: magento2

I have upgrade magento version from 2.1.14 to 2.2.0. First time when i run run php bin/magento setup:upgrade command it gives this error: Module 'Magento_TaxImportExport': Module '...
0
votes
0answers
25 views

magento2 Mysql count number customers who ordered more then once in a specific date range

I have a Magento 2.2.5 based website and I want to get a list of emails of customers who have made more than 2 orders within a specific date range. I know I can do the below MySQL query to list ...
0
votes
0answers
21 views

Can insertMultiple method return all inserted auto-increment ids?

I have to insert rows in two custom tables (which have a many-to-many relation). I want to use batch insert (i.e. insertMultiple method in Magento 2) for the parent and child table both. The issue ...
0
votes
1answer
818 views

The following exception is caused by a lack of memory and not having swap configured in magento 2

When trying to install the sample data via this command php bin/magento sampledata:deploy got an error The following exception is caused by a lack of memory and not having swap configured. Can ...
0
votes
0answers
22 views

Magento1.9 - Selected option with explode array exception

We're having an issue with getting a selected option from our database. It's a custom made plugin, but it contains a few option values, like these: array( 'value' => 17529, 'label' => ...
0
votes
1answer
98 views

Magento 2.2.2 Products Not Showing Category and List Page

I have a real hard time solving this issue. The issue is products Not showing on front end Category Pages and Product Listing Pages after import via CSV - Just shows We can't find products ...
0
votes
0answers
10 views

Magento 2 Categories SQL Import statement just placing meta data

I am trying to place meta data on already existing categories. I received the names of categories and the new meta data that is all. I was wondering if there is fast sql statement that will find ...
1
vote
1answer
138 views

Magento 2 : Delete all Catalog Price Rules Programmatically

I know we have Delete Rule option when we edit any Catalog Price Rule. But I need to delete all Calalog Price Rules programmatically because there is no option to delete all rules. Solutions may be : ...
1
vote
1answer
47 views

Uninstall Magento 2.3 module (including database data) Getting Exceptions Error

I am trying to uninstall some modules in my Magento 2.3.1, I followed the following steps: Remove the module Vendor_% from app\etc\config.php Drop module tables or columns from database, please check ...
0
votes
1answer
105 views

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails

when i update my any product from magento admin back end below error come SQL STATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (db ...
3
votes
0answers
53 views

Magento 1 on Percona DB produces errors

We are trying to migrate our DB to MySQL 5.7 on Percona XtraDB cluster. In the MySQL log file there are errors preventing some operations to be performed. The errors visible with the current setting ...
0
votes
0answers
48 views

Magento 2 image uploading problem

We have the problem when uploading product images into Magento 2 store. When we upload the image is shown up into the backend but not in the frontend. There when you inspect the image you will get a ...
0
votes
0answers
36 views

Magento 2.3 - Database Backup not working

I want to backup my database on a daily basis. i did following setup in my magento admin panel. https://prnt.sc/odgzhv But no backups are generated in magento/var/backups folder. Is there any thing ...