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

Custom script to update stock levels

I need to write a cron job which will import stock levels every 15 minutes from a wholesaler using SKU numbers as the unique identifier. My previous shopping cart had a table containing both the qty ...
0
votes
1answer
980 views

Sku field null in category_product_flat tables

We have a store, Magento 1.6 with circa 4500 products. Half of the products approx are having this issue: Symptoms... Admin Product Grid -> sort by SKU causes a fatal error. Admin Product Grid -> ...
1
vote
2answers
2k views

getting error “Table doesn't exist” in magento innodb database when browsing in phpmyadmin or sqlYog

I have moved magento database (copy and paste xampp/mysql directory) from another system to my laptop(windows7,xampp), and configure mysql service path(xampp control panel showing run mysql fine). But ...
2
votes
2answers
894 views

What is stopping my Magento Database upgrading

We currently are working on 2 Magento sites, one is Enterprise 1.11 and one is Enterprise 1.13, if we take too long testing out all out modifications in 1.13 then we plan on getting a security patch ...
2
votes
1answer
1k views

How to create delete url to delete row from table

How to create an URL for a link (on frontend),that ,when clicked, will call a function that deletes a row from the table. Manually it works :) public function deleteMessage($id) { Mage::...
1
vote
1answer
1k views

Update Product Names To Title Case

After exporting my previous database, allot of my product names where upper case. I now want to run a sql query to update the product names to title case. What is correct way to do this
6
votes
2answers
14k views

Order item custom options

In which table I can see ordered item's custom options and its chosen value. I can see a product_options column in table sales_flat_order_item, but not sure is it same as product's or item's custom ...
1
vote
1answer
716 views

How do you set Allow Countries directly in the database, programmatically or using n98-magerun?

I have a list of over 200 countries I need to allow for an EE 1.13 site. I'd prefer not to do this through the admin interface because it is tedious and I am error prone. Is it possible to set Allow ...
2
votes
1answer
293 views

comparing form data with database

I am trying to work out what would be the fastest way to compare user data which has been entered into a form with user data that is already stored in the database. My plan was to pull all details of ...
2
votes
1answer
935 views

pull database data into a text field

I have created a table in my database as part of my custom module. I would like to add user information into a text field from the custom table based on parameters in the address bar. So far I have ...
1
vote
2answers
2k views

Force a reconnect to Mysql

Is there anyway I can force a reconnect to Mysql with Magento? or Replace the connection entirely? I have an importer which is slow, and is very custom using Magento models. Before you say it... No I ...
0
votes
1answer
204 views

How to update the child table

I am currently struggling through my first magento project and it seems to be leaving me with asking more questions than it has answered. My current hurdle is adding default data to a child table. I ...
8
votes
4answers
15k views

How to overcome timezone problem in Magento?

I used this method, to add date and time picker in magento backend. Now the input time is getting stored to my database correctly. The problem is my magento store's timezone is set to Indian Standard ...
0
votes
1answer
610 views

addFieldToFilter doesn't return the right product for selected attribute values

I am currently programming a product configurator module for Magento. Everything is working fine so far besides the core functionality: choosing the right product from the database for the selected ...
2
votes
2answers
3k views

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I'm using Google API to generate store locator in my module. I've stored all the store addressed in a separate table and accessing that table through direct SQL query to match locations inputted by ...
1
vote
1answer
3k views

Not saving data to database in magento

Hi i write valid queries for data insertion but not successeded.If i print that query and excute it on sql server it works.I didn't figure out why this not works. This is my table structure. CREATE ...
0
votes
1answer
4k views

“Database connection error” when installing 1.7.0.2 on Ubuntu

I'm installing Magento version 1.7.0.2 on an Ubuntu VM, hosted in Azure - I'm getting "Database connection error" in the Magento Installation Wizard. I've installed PHP & MySQL as instructed here....
28
votes
3answers
31k views

Delete custom EAV attributes from the database

I want to remove unused EAV attributes directly from the database before I move my store live. Attributes can be found in eav_attribute table, can I delete attributes from this table? Is it safe? Or ...
2
votes
1answer
3k views

Magento site shows error SQLSTATE[HY000]: General error: 5 Out of memory

One of our store show following error and stop working at all. SQLSTATE[HY000]: General error: 5 Out of memory and Mysql / Innodb Error InnoDB: ERROR: the age of the last checkpoint is 943460 [...
1
vote
1answer
1k views

Magento - Can't connect to Mysql server error frequently

We have a dedicated server with a virtual instance running the application server with Apache, PHP and a virtual instance with DB on it. We are running Magento 1.7.0 version on the application server ...
2
votes
2answers
1k views

CE 1.7: Merge two different databases in 1

Well Hello, I've the need to merge 2 different databases together. But! I need to keep some data from 1 and other data from the other one... DB 1: is a multisite setup DB 2: is only 1 website... ...
1
vote
3answers
300 views

Binary logs in Magento 1.7

We are a team working with Magento 1.7. In order to manage deployment between different developer working with the same database of Magento. We suggest to use binary logs. Each developer will possess ...
0
votes
1answer
568 views

Update Option Type Checkbox to Dropdown

I want to edit my Magento option type for 181 products, changing checkbox and radio to dropdown Can i just create a mySQL query to change field in catalog_product_option, replacing checkbox and radio ...
6
votes
3answers
3k views

Magento keeps invoking install script after deployment

I'm trying to move my Magento store from local to web server. But I run into a problem: The install wizzard pops out, I can't figure out why. What I tryed till now: Double checked the database ...
4
votes
3answers
12k views

Disable modules via database

I don't have access to the backend and need to disable all the modules. How can I disable them via database?
0
votes
1answer
82 views

Move products and attributes from 1.4 db dump

I have a db dump from an old magento installation. From this I would like to move all products and attributes. The db dump was taked from a 1.4 instllation and it will be going to a 1.7 This is not ...
1
vote
2answers
6k views

Select Product Where Price Is Greater Than Zero

Given the following code: $mageProductCollection = Mage::getModel('catalog/product') ->getCollection() ->addAttributeToSelect('*') ...
0
votes
1answer
474 views

Add Product Id Array To Custom Table From Admin

I think I've kicked the hornets nest. I have a custom db table. I am displaying a list of products in admin similar to the related products tab or the upsell tab. I want the id's of selected products ...
2
votes
3answers
2k views

Safe for model method to rely on loaded model state?

Is it safe for a model method to rely on the model being in a loaded state i.e. accessing a data value? An simplified example: public function testMethod() { return 100 x $this->getData('...
3
votes
2answers
7k views

Magento Table Creation Using ORM Method

I'm trying to create a new table in the Magento database using Magento's *Varien_Db_Ddl_Table*. Using fresh Magento 1.7.0.2 CE install for this. I'm at a loss for syntax though. I'm trying to create ...
5
votes
3answers
2k views

How do I add additional options to customer gender?

I have a client who would like to add the option 'Transgender' in addition to Male and Female in the gender field. Can I do this directly in the database? Would I need to update anything beyond the ...
3
votes
1answer
3k views

Importing attributes to a new magento installation

What are the tables I need to dump to be able to import them in a new installation? I need this to avoid reinserting all the custom attributes for every new Magento installation. thanks
0
votes
1answer
4k views

Help connecting Magento to a third-party REST API

I need to update Magento products using a third party API. What is the best method of doing so. Should I trigger an API call when an event/observer hits on product detail page? There is no OAuth yet, ...
1
vote
4answers
1k views

Advanced search is partially broken after MySQL upgrade to v. 5.6

Maybe someone have been experienced the same problem and have solution for this? My hosting provider was upgrading recently the MySQL version to 5.6 and after that the Advanced Search can not find ...
3
votes
2answers
6k views

getReadConnection() error

I am trying to follow http://codemagento.com/2011/03/creating-custom-magento-reports/ the simple report example. I get the following error: Fatal error: Call to a member function ...
3
votes
1answer
2k views

Database — What are log_url + log_visitor ? Can I truncate them?

I've to move a 9.8GB database from a live server to local so I can fix stuff without going offline. But, I just noticed that there are log_url_info = ~23,039,809 = 2.1 GiB log_url = ~22,...
16
votes
4answers
18k views

Add Column to a grid (observer) - Column ‘store_id’ in where clause is ambiguous issue

I'm adding a column to the order grid using observer approach: On the event -> sales_order_grid_collection_load_before I'm adding a join to the collection On the event -> ...
0
votes
1answer
976 views

I can't cancel orders. Integrity Constraint Violation [closed]

Whenever i try to delete an order, by entering the order and then clicking cancel, i get a "The order has not been cancelled" Message. I tried deleting the order from the list, and issuing an action ...
1
vote
3answers
2k views

Moving Products from 1.4 to 1.7 - dilemma

I've to move a lot of products from an old Magento site (v. 1.4) to a new one (1.7) with fresh new theme with new modules it's also a multisite, infact there' already a lot of stuff I configured in ...
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 ...
1
vote
1answer
918 views

How to override the graph in dashboard

I have a table included some data about warehouse operation (order_id, phase, duration, datetime, order_canceled), so I need to draw a graph to present these data for performance management. I tried ...
1
vote
2answers
2k views

Delete custom options from products in specific store

Within one installation of magento (1.7.0.2) I have 1 website with 2 stores. In store #1 there are 1000 simple products with custom options. In store #2, using Magento Store Manager, I created copies ...
15
votes
1answer
3k views

Mechanics of the new Changelog Tables (ex: catalog_category_product_cat_cl)

I just spotted the mentioned tables in the database. I think they are new in Magento EE 1.13 and might be related to the new indexing. +----------------------------------------+ | ...
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 ...
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 ...