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

Add value for custom quote item attribute using REST api

I want to add value for custom quote attribute using rest api. This attribute is not a product attribute. I have created a database column in quote_item table. Also created the plugin on class Magento\...
0 votes
1 answer
1k 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
1 answer
19 views

How to change the value "is_required" in the table eav_attribute in the entity_type_id "2" and with the attribute_code "lastname" programmatically

Good day people, I have been trying to change the value "is_required" in the table eav_attribute in the entity_type_id "2" and with the attribute_code "lastname" in ...
1 vote
2 answers
21 views

Magento and MySQL: Access denied for user 'username'@'localhost' (using password: YES)

I am setting up an existing Magento site to run locally. The site uses MySQL, which I have installed and running on MacOS. I created a user doing the following: > $ mysql -u root CREATE USER '...
0 votes
1 answer
18 views

How to make id field auto increment in db_schema.xml in mageno 2.4?

I have a custom table created through db_schema.xml (code below): <?xml version="1.0"?> <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:...
2 votes
1 answer
815 views

Multiple Where Statements

I have the following line of code $select = $read->select() ->from($batchTable,array('id','batch','strength','flavor','brand')) ->where('status', 1) ->...
4 votes
1 answer
1k views

How to get round Price Value in Grand Total Magento 1.9.2?

How can I achieve round price value in Grand Total?
1 vote
1 answer
531 views

Add increment id in custom module

I have made a custom module for sellers. There, I want to add a functionality of commission invoice. For the same, I want to have an increment id like in sales_order. The increment id should start ...
1 vote
0 answers
21 views

ShipStation Shipping Label creation is not working Magento 2.4.2

We upgrade the Magento 2.2 to 2.4.2 . We have configure the ShipStation as shipping. But we are not able to create shipping label. We are stuck in Add to products to packege popup. Save button doing ...
2 votes
1 answer
2k views

How to add select state dropdown field in custom phtml form and save in database(frontend) in magento2.2.5?

I have added a select state dropdown field in my custom phtml file. But not able to save that value in database in Magento2.2.5? /var/www/html/magento2/app/code/Amy/Contactform/Block <?php ...
9 votes
3 answers
2k views

SQL query kills entire server

I caught the following query via mysql's SHOW FULL PROCESSLIST; which was eating the whole CPU / RAM on my server (32GB Ram, i7 hexacore CPU) rendering the entire server unusable for more than 3 hours....
6 votes
3 answers
3k views

Install Magento2 using different MySQL port

I have MySQL server running on a different port than the default one. Suppose, the default port for MySQL is 3306. I have another MySQL server running on port 5625. I want to install Magento2 using ...
0 votes
1 answer
1k views

Magento 2 add new column to existing table on a running webshop

I know there are a few posts regarding how to add a new column to the existing table in Magento 2. My concern is if I already have a webshop that is running, can I still add a new column to a table? ...
0 votes
1 answer
18 views

Magento 2 - can't add foreign key constraint with declarative schema (db_schema.xml) - Reference column X in reference table Y do not have index

I try to add this table: MODULE/etc/db_schema.xml: <?xml version="1.0"?> <schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="...
1 vote
1 answer
98 views

creating update for a custom module

My question is about creating update for a custom module extension that I have made. I have no idea where to begin. So breafly here is what my module does It create a database table Stores data from ...
1 vote
2 answers
2k views

Retrieving size attribute text via MySQL in Magento 2

I'm working on a PHP file that will run on cron (outside of the Magento 2 directory). I'm writing some scripts that fetch various data such as customer details and the items they've ordered. ...
1 vote
1 answer
145 views

Error when try to get data from custom database

When i try to call out my block with data from my custom database, i get an error a:5:{i:0;s:229:"Error in file: "/var/www/ifp.dk/public_html/app/code/local/Puk/EmailOrder/sql/emailorder_setup/...
2 votes
2 answers
7k views

Select Product Where Price Is Greater Than Zero

Given the following code: $mageProductCollection = Mage::getModel('catalog/product') ->getCollection() ->addAttributeToSelect('*') ...
1 vote
2 answers
3k views

Custom module with custom database table and per store settings

I am creating a custom module with a custom database table using the following tutorial. This module is a custom contact form, and I would like the settings for that custom contact form to be on a ...
0 votes
2 answers
1k views

Magento very high connections

Magento is creating 700 + connections leading to database breakdown whenever cache is flushed or indexing is triggered. Production site remain down for 20 mins till all connections clears. All ...
2 votes
1 answer
2k views

How to define custom table and retrieve the data into grid?

i'm writing a module to retrieve the data from a table (i manually created it by using phpmyadmin), but i don't know how to access it in grid.php <?php class ...
1 vote
3 answers
275 views

Magento 2 - Syntax error on bin/magento support:backup:db

I am trying to get backup of DB using following command php -dmemory_limit=1G bin/magento support:backup:db It is giving me syntax error: sh: 2: Syntax error: word unexpected (expecting ")") Error: ...
1 vote
2 answers
2k 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 screen at the bottom, I am getting the error message below: Exception during cache and session cleaning: Error in ...
3 votes
2 answers
214 views

Time to first byte taking 800ms - put same array outside of magento is 90ms any ideas?

Alright, I normally don’t ask for help, but on this one I am a little baffled. I am working on a website where we do a ajax post, that goes through my Magento module’s IndexControler and sends back ...
3 votes
1 answer
442 views

Where to store config passwords

I want to have a custom database connection with a module I am creating. I am following this tutorial which will work well: http://fishpig.co.uk/magento/tutorials/create-external-database-connection/...
0 votes
4 answers
53 views

Magento 2 "PathInfoProcessor\Proxy” does not exist

My PHP version: 7.4.29 I am run this command on window 10 php bin/magento setup:install --base-url="http://mat.magento.com/" --db-host="localhost" --db-name="magento2" --...
2 votes
3 answers
4k views

The attribute model is not defined

Can you help me? I have a Magento site that throws this error when I search for products: a:5:{i:0;s:34:"The attribute model is not defined";i:1;s:4717:"#0 /var/www/mystore.com/public_html/app/code/...
3 votes
1 answer
64 views

what folders and files in module is reason for creating tables in database?

I saw one module folders and files in magento connect. in that only etc, Helper, & Module folder is present. but there is no sql folder. but still that module created a text box in backend , so ...
1 vote
2 answers
101 views

Magento 2: setup:upgrade error with customer_grid_flat index

I tried to run setup:upgrade command from Magento source but it's always get error: SQLSTATE[42000]: Syntax error or access violation: 1170 BLOB/TEXT column 'created_in' used in key specification ...
0 votes
1 answer
1k views

Integrity constraint violation: 1062 Duplicate entry - After theme change

After I changed my theme I am getting error messages in Magento log and also the checkout is working correctly if I use my previous theme. The other thing is it's saying Duplicate entry '63' for key '...
2 votes
2 answers
12k views

Can't retrieve entity config: Module Sql Setup Error

In my custom module, while setting sql_setup i got this error, Can't retrieve entity config: membership/members" Error Report: a:5:{i:0;s:163:"Error in file: "C:\xampp\htdocs\ems\app\code\local\...
3 votes
1 answer
2k views

Why can't I reinstall Module Magento?

I have a module in magento, and the script setup module. Now I want to re-run this script and this module. I deleted the setup of this module in core_resource, and access magento. But the module is ...
4 votes
1 answer
3k views

Is it safe to modify database table column datatype directly?

I am able to change Catalog Price Rules' from_date and to_date from "date" datatype into "datetime", by overriding the classes: Mage_Adminhtml_Block_Promo_Catalog_Edit_Tab_Main ...
4 votes
1 answer
909 views

Can I remove module info from Column "Extra" in Magento Admin_User Table?

I like my Magento database as clean as possible so whenever I uninstall an extension I also remove all data that was stored by this particular module from the database. Now I noticed that there is ...
0 votes
1 answer
1k views

Unknown column 'e.category_ids' in field list in product list

We have an error in product list page, we trying to update product details page we getting the following error. exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown ...
7 votes
3 answers
23k views

MySQL error while importing database

I want to upgrade Magento. Therefor I first want to transfer the live production system to a development workspace. I am trying to import the production database into a clean database. But I can't get ...
0 votes
2 answers
1k views

Submit form values using controller and model in magento frontend module

I am building an module and need to process a form but am having troubles getting the variables to POST and am just redirected to the same page. The form looks like this : <form id="...
1 vote
1 answer
1k 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. ...
0 votes
2 answers
207 views

Docker magento 2 setup issues with Mysql (markshust/docker-magento)

Facing a MySQL connection issue while Magento2 setup with docker at local I have followed the steps mentioned in the existing project in the below link markshust/docker-magento: Mark Shust's Docker ...
0 votes
1 answer
19 views

how to create aws instance and setup magento 2

I want to use aws EC2 service and RDS for database and going to setup magento 2 project using gitLab so anyone have idea then please share with me. Thanks in advance.
4 votes
3 answers
4k views

Print INSERT Query in saveAction [duplicate]

I have a custom module where my few DB fields are not being saved properly. I can see the values selected in $model->getData(); but it does not reflects in my Database. try { echo '<...
1 vote
4 answers
720 views

How to check installed extensions on database magento 2

I need to check installed module on database table I hope your help Thanks Thomas
6 votes
2 answers
15k views

How do I get data from my custom module table?

I have a custom module with its own table which saves the date inside the column named date_to. I am trying to access the values from only this column but when I load the collection and call getData('...
5 votes
1 answer
2k views

Module Config File: what are resource connection definitions for

I searched for that information quite a while but did not found any explanation. Many examples and tutorials for custom modules with custom database tables suggest the following for the config.xml ...
0 votes
2 answers
3k views

SQLSTATE[HY000] [2002] Connection refused

9.3.6 website. It works fine but sometime it shows SQL error and sometimes it shows many times in a day. here is its trace records SQLSTATE[HY000] [2002] Connection refused Trace: #0 /public_html/...
0 votes
2 answers
3k views

How to write inner join query in collection method (magento2)?

How to write this query in magento2 collection method? SELECT o.increment_id , h.status, h.created_at FROM sales_order AS o INNER JOIN sales_order_status_history AS h ON h.parent_id = o.entity_id ...
0 votes
1 answer
18 views

Magento 2 - Get product attributes selected value via MySQL

I am trying to get a products selected attribute value via MySQL. Basically, what I need is the SQL equivalent of this: $_product->getResource()->getAttribute('my_attribute')->getFrontend()-&...
14 votes
1 answer
10k views

Magento 2 - Database transaction for multiple model / resource model objects?

If I have a logic that involve updating multiple model objects which will update a few tables in database, how to provide a database transaction to ensure the data integrity?
0 votes
4 answers
2k views

How to change my url from www.xxx.com/Magento to www.xxx.com

I am running Magento 2.2.7 and my current URL for my store is https://shop.xyz.ca/Magneto and I would like to change it to be https://shop.xyz.ca/ I am set up on Windows Server and using Xampp 3.2.2 ...
0 votes
2 answers
1k views

Magento 2 : run multi query on upgrade database

For upgrade database, I use direct SQL such as belove code $setup->run("delete from directory_country_region"); $setup->run("TRUNCATE directory_country_region"); $...

1
2 3 4 5
73