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
0answers
15 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
133 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/...
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.
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 ...
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
28 views

What is the “static” backend type in EAV attribute Magento 2?

In the "eav_attribute" table I discovered that some attributes have the backend type set to "static". Example, attribute_code = 'telephone' & entity_type_id = 2 resulted in a "static" backend ...
0
votes
0answers
33 views

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.attribute_set_id'

I am trying to Filter the products based on vendorid with attribute_set_id. if i use print_r in the collection i am getting the result like below $objectManager = \Magento\Framework\App\...
0
votes
0answers
27 views

What is correct way to create an admin form that doesn't save to database?

My goal is to create an admin page that allows site administrators those with specific roles to change a password on behalf of a customer. At the moment I seem to be having issues creating a page in ...
2
votes
3answers
41 views

M2 - Change end date of all coupon codes

In the database there is a table called salesrule_coupon which has all the coupon codes in it. I need to change the column expiration_date for all the coupons to the same date 30-08-2024, Is This ...
0
votes
1answer
30 views

Magento 2 - Orders saving as local timzezone

I have an issue with how a Magento 2 store is saving orders. My understanding was that orders are saved in UTC. However, when new orders are placed, it is saving them as our local timezone in the ...
0
votes
2answers
51 views

table missing after upgrade to 2.3

I upgraded to Magento 2.3 and got this error on the top of the admin page. SQLSTATE[42S02]: Base table or view not found: 1146 Table 'a15809b3_m2.magento_bulk' doesn't exist, query was: SELECT ...
0
votes
0answers
10 views

Magento 2 - I have removed duplicated tables from database and part of home page is not showing

Magento 2.2.7 In DB I have found that I have a duplicated database. My database tables have prefix dev_ while there were identical tables without prefix that was probably left after some "test" ...
0
votes
2answers
31 views

Magento 2 - Create a log file in plugin that will print log when data is inserted in database

I have entered data in the database using object Manager in Model file itself. I want to print a log file from the plugin that will print the log of the last data that is inserted in the database.
0
votes
0answers
7 views

Magento 2 - add stored procedure via installer

There are lots of articles about how to add stored procedures / triggers in Magneto 1, but what is the best practice to do this in Magento 2?
0
votes
0answers
25 views

Issue with flat catalog table product collection in Magento 1.9

I am facing an issue regarding magento product collection as I have some additional product attribute and use general way to get product collection like: Mage::getModel('catalog/product')->...
0
votes
0answers
22 views

Magento 2 - Problem inserting Data in the Database using objectManager

I want to insert data in the table directly using object Manager from Model file. I am providing the code snippet but this isn't inserting the data. I want to know the correct syntax to perform the ...
0
votes
0answers
29 views

Mysql query INSERT INTO “search_tmp…” never ends after mass attribute update in Magento 2.3.0 Causes Server overload and site down

MySQL query INSERT INTO “search_tmp…” never ends after mass attribute update in Magento 2.3.0 Causes Server overload and site down my mysql found this query very sluggish and slow, which is as ...
1
vote
1answer
36 views

Magento 2: Order Increment Id not working

In our website, magento order increment id is not working as expected. We are getting difference of 3 between every two orders. Like for example,we have order 000005167 and next order we are getting ...
0
votes
2answers
29 views

product view count table in database magento 2?

I have to write code for getting 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
2answers
40 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() ->...
0
votes
1answer
29 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
42 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 ...
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
1answer
31 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
51 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 ...
1
vote
2answers
216 views

In magento 2, how to edit the uploaded image field

In magento 2, how to edit the uploaded image field I follow this blog https://blog.qaisarsatti.com/magento_2/magento-2-ui-component-image-upload/ ui-component <field name="promo_image"> ...
1
vote
1answer
19 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
0answers
20 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 ...
1
vote
1answer
29 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 ...
1
vote
0answers
36 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 ...
1
vote
1answer
43 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
24 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
0
votes
0answers
12 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
35 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: ...
0
votes
3answers
72 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
1answer
17 views

Could someone please help with some questions related to using Magento 1 database backup functionality?

I want to get a Magento 1 backup using Magento's backup functionality. (Reference:https://docs.magento.com/m1/ee/user_guide/system-operations/server-backup-create.html) I'm are running Magento ver. ...
1
vote
0answers
68 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
0answers
22 views

What to do in order to allow hyperinflationary currencies? (How to increase decimals limit)

We have to allow in our multi-currency site currency that's very hyperinflationary. Base price for products are set in USD but We have some products shown in VEF that are very close to Magento 2 ...
1
vote
1answer
50 views

Explanation about getSelect() join() joinLeft()

I don't understand these functions of Magento 1: getSelect() join() joinLeft() Where can I find a complete doc with all functions documentation ? Thanks..
0
votes
0answers
24 views

Automatic price change on daily basis in magento 2

We have a client site who is having gold jewellery magento shop. In that the jewellery prices are daily changing,so he have to update each jewellery items price often. (The logic we have here is 1 ...
0
votes
0answers
18 views

Key search displays sql in magento 1

I know that there is an extension showing this text. Can someone show me 1 keyword to search for? I tried searching toString();, but all code comment.
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]: ...
1
vote
1answer
31 views

Magento 2.3.1 Merge products from one database to another?

I have a staging and a production server for my Magento 2.3.1 project. The two databases have different data and configurations, so I can not just dump the mysql db and restore it. Is there a way to ...
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
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 ...
1
vote
1answer
64 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
60 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
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 (...
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/...