Magento Installation Problem – MySQL Access Denied

I was installing Magento on one of my commercial sites just to try it out and ran into this installation problem:

The error message explains itself: there is a database connection issue and it’s probably because either your username and / or password don’t match or your account doesn’t have the privilege for this execution.

My question was exactly about that, too. “Why does it try to access MySQL database using the ‘root’ account? ”

I’m using shared hosting service from HostGator for this site, and I don’t have the root access to any of my MySQL databases. For example, my username for a DB would look like “ebiz_magento”, not ‘root’. This is a common case when you don’t have a dedicated server.

Something must’ve been messed up during my installation process because I couldn’t simply believe that they would’ve set the root account as default DB access for the installation.

So where is the file that has this incorrect DB access configuration?

After spending over 30 minutes, I found this file that contains the database access information.

It’s an XML file, ‘local.xml’ under ‘/app/etc/’.

Change the username, password and dbname appropriately.

After a couple of days later, I figured out why I had this problem. I had installed the software locally on my Windows using the root account for MySQL before I did on my server. I uploaded the files from that directory where it was configured to use the root account in ‘local.xml’.

When I checked the files freshly upzipped from the installation file, I found it doesn’t have the file ‘local.xml’.

By AbdulHakim Maina, February 2, 2010 @ 3:52 pm

Thanks mate! You really saved me a lot of bother trying to db connection settings.

Source

Magento & WordPress Integration

Magento is a well architectured, open-source e-commerce platform that are widely used these days. It has many professional and flexible functionalities, but one of the lacking features is a blogging tool. Its CMS is suitable to write static pages for websites, not for blogging. But there is another great open-source blogging software that is loved by numerous bloggers, WordPress. Integrating these two tools is not generally a big issue.

There are a couple of ways to integrate Magento e-commerce store with WordPress blog.

– You can install Magento plug-in to integrate WordPress. This extension allows you to manage both the store and the blog on the same interface. However, it seems some users have experienced difficulties to make it work especially when they use a customized / non-default theme. Download WordPress integration plug-in: Magento Extension – WordPress Integration

– Another way is to install both of them separately and modify .htaccess file(s) so that they won’t have conflicts.

One of the most common fixes of .htaccess related issues is to define RewriteBase in one of the .htaccess files.

Let’s say I’ve already installed my Magento store on ‘http://www.mystore.com’ and now I want to install WordPress blog to ‘http://www.mystore.com/blog/’.

Most likely, I don’t need to modify Magento .htaccess file. But I need to define RewriteBase and change RewriteRule appropriately in WordPress .htaccess file as follows.

By Jermaine, June 19, 2009 @ 10:05 am

Hi. Let’s say I’ve installed WordPress first and now want to install Magento. How could I make this work?

By ae, January 20, 2010 @ 12:44 pm

Of course, the if you devise a new Magento template the output need not be html. It might be slow but you could integrate the two by having wordpress consume the output from Magento.

Source

Magento CSS Ordered / Unordered List Style in Product Description

Depending on your theme, lists of product short description may appear without any type as in “list-style: none”. This happens when the default list style is defined ‘none’. Make sure you define list styles separately for product short description, category description or other areas for such styles as a disc or an image.

The fix will look like this:

.short-description ul li { list-style-type: disc; list-style-position: inside; }
.short-description ul li { list-style-type: disc; list-style-position: inside; }

Source

Delete Test Orders in Magento Using MySql Queries

Many Magento users find it very disappointing not to be able to delete test orders or at least to make them removed from the Admin Sales page.

It’s a required step that merchants or developers place several test orders before they officially launch the site. Obviously, they don’t want their test sales mixed in the regular sales reports. It’s hard to believe, but there is no easy solution for this in Magento Admin panel.

These MySql queries can be handy when you want a fresh start with your Magento store. This is not a definite solution because you directly update the database using queries and also because it works only when you can remove all order data.

This includes queries to delete customer data and orders for downloadable products.

Don’t forget to backup your DB before you run these!

SET FOREIGN_KEY_CHECKS=0;

– Reset sales data
TRUNCATE `sales_order`;
TRUNCATE `sales_order_datetime`;
TRUNCATE `sales_order_decimal`;
TRUNCATE `sales_order_entity`;
TRUNCATE `sales_order_entity_datetime`;
TRUNCATE `sales_order_entity_decimal`;
TRUNCATE `sales_order_entity_int`;
TRUNCATE `sales_order_entity_text`;
TRUNCATE `sales_order_entity_varchar`;
TRUNCATE `sales_order_int`;
TRUNCATE `sales_order_text`;
TRUNCATE `sales_order_varchar`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_flat_quote_address`;
TRUNCATE `sales_flat_quote_address_item`;
TRUNCATE `sales_flat_quote_item`;
TRUNCATE `sales_flat_quote_item_option`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sendfriend_log`;
TRUNCATE `tag`;
TRUNCATE `tag_relation`;
TRUNCATE `tag_summary`;
TRUNCATE `wishlist`;
TRUNCATE `log_quote`;
TRUNCATE `report_event`;

ALTER TABLE `sales_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_datetime` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_decimal` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_int` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_text` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_varchar` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1;
ALTER TABLE `sendfriend_log` AUTO_INCREMENT=1;
ALTER TABLE `tag` AUTO_INCREMENT=1;
ALTER TABLE `tag_relation` AUTO_INCREMENT=1;
ALTER TABLE `tag_summary` AUTO_INCREMENT=1;
ALTER TABLE `wishlist` AUTO_INCREMENT=1;
ALTER TABLE `log_quote` AUTO_INCREMENT=1;
ALTER TABLE `report_event` AUTO_INCREMENT=1;

– Reset customers data
TRUNCATE `customer_address_entity`;
TRUNCATE `customer_address_entity_datetime`;
TRUNCATE `customer_address_entity_decimal`;
TRUNCATE `customer_address_entity_int`;
TRUNCATE `customer_address_entity_text`;
TRUNCATE `customer_address_entity_varchar`;
TRUNCATE `customer_entity`;
TRUNCATE `customer_entity_datetime`;
TRUNCATE `customer_entity_decimal`;
TRUNCATE `customer_entity_int`;
TRUNCATE `customer_entity_text`;
TRUNCATE `customer_entity_varchar`;
TRUNCATE `log_customer`;
TRUNCATE `log_visitor`;
TRUNCATE `log_visitor_info`;

ALTER TABLE `customer_address_entity` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `log_customer` AUTO_INCREMENT=1;
ALTER TABLE `log_visitor` AUTO_INCREMENT=1;
ALTER TABLE `log_visitor_info` AUTO_INCREMENT=1;

– Reset purchased downloadable data
TRUNCATE `downloadable_link_purchased`;
TRUNCATE `downloadable_link_purchased_item`;
ALTER TABLE `downloadable_link_purchased` AUTO_INCREMENT=1;
ALTER TABLE `downloadable_link_purchased_item` AUTO_INCREMENT=1;

– Reset all ID counters
TRUNCATE `eav_entity_store`;
ALTER TABLE `eav_entity_store` AUTO_INCREMENT=1;

SET FOREIGN_KEY_CHECKS=1;

By Chickpea, November 5, 2009 @ 9:47 am

Can anyone confirm this code works for Magento ver 1.3.2.4? Seems to work for me but not fully tested it yet!

By Matritos Marikon, January 25, 2010 @ 11:29 am

You rock man !
You just saved me hours of sweating over Magento.

Worked perfectly for Magento ver. 1.3.2.3

Source

Magento Table Structure

When you first look at Magento database, it can be overwhelming because of its complexity. The Magento database is heavily dependent on EAV (Entity Attribute Value) model. While the EAV model makes it easier to expand the database, i.e. adding your own entities or attributes specific for your store, SQL codes can be very difficult to write.

Before you customize Magento database, make sure you read through EAV model and you understand Magento table structure thoroughly.

EAV Core Tables
All EAV tables are prefixed with “eav_”.

Table Sets (Table collections)
In Magento database, an entity can have several tables that share the same prefix. For example, the product entity has the catalog_product_entity table for its main data and several other tables prefixed with “catalog_product_” such as catalog_product_entity_int, catalog_product_entity_media_gallery, catalog_product_entity_text and so on.

To store the data more efficiently, product details are stored separately depending on their data types. When the value of the data is an integer type, it’s saved in the catalog_product_entity_int table, and when its type is an image, it’s saved in the catalog_product_entity_media_gallery table. The whole point is not saving big image data with small integer data in the same table.

Tables to Define Relationships
The catalog_category_product table, catalog_product_website or downloadable_link_purchased are examples of the tables that show relationships. The catalog_category_product table show which category includes which products and the downloadable_link_purchased table shows which order has which downloadable links.

By LED Downlights, November 4, 2009 @ 11:15 pm

Thanks for publishing this article, its quite helpful as im trying to manually import products into magento and am slightly confused by all the tables.

By Cobay, March 20, 2010 @ 8:50 am

gooo..posting…
have a nice day~~~

Source

Change Order of Blocks – ‘before’ and ‘after’ attributes

Use ‘before’ and ‘after’ block attributes to change the order of blocks. You can set the position of a block within a structural block by assigning the name of another block to either ‘before’ or ‘after’ attribute.

For example, if you’d like to put ‘Product Viewed’ box below ‘Cart’ box on the right menu, you can define the layout XML files as follows:

You can define block position at the very top or bottom by using before=”-” or after=”-”.

Source

Change Order of Blocks – ‘before’ and ‘after’ attributes

Use ‘before’ and ‘after’ block attributes to change the order of blocks. You can set the position of a block within a structural block by assigning the name of another block to either ‘before’ or ‘after’ attribute.

For example, if you’d like to put ‘Product Viewed’ box below ‘Cart’ box on the right menu, you can define the layout XML files as follows:

You can define block position at the very top or bottom by using before=”-” or after=”-”.

Source

Magento Speed and Performance

Magento is one of the most flexible open-source e-commerce applications that comes with lots of desirable features for shopping-cart sites. However, due to these various functionalities, its performance can be a major issue.

Magento provides helpful resources in its blog and forum to improve performance including database tuning and server configuration modification. But in many cases, these performance enhancements should be done through system administrators of your hosting company or would work only when you have a dedicated server. Read more about Magento Performance Improvement.

An easier way to improve Magento website speed is to turn on GZip compression via .htaccess. GZip compression is a kind of technique to compress textual content when it’s transferred from the web server to a user’s browser.

A single web page from a Magento site can be a few hundreds KB -one of my site shows its homepage size is 500KB when Yahoo homepage is 200KB! (you can check this by clicking Information View Document Size from FireFox developer’s tool bar.)

GZip compression can reduce page size significantly and transfer the data faster to your site visitors.
The files that can be compressed are text files such as XHTML, JavaScript or CSS. Image, video or other multi media files are already compressed.

Find the section for “mod_deflate.c” from your .htaccess file and uncomment the settings as follows:

# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems…
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
# Don’t compress images
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary

# Make sure proxies don’t deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>

php_flag zlib.output_compression on

Notes:

By osCommerce Templates, April 22, 2009 @ 8:01 pm

Thanks for this one. This will significantly help to those who have problems configuring the Magento including myself.

I have to agree that Magento is quite hard to configure if you are a first time user of the software.

By fred perry, February 19, 2010 @ 2:56 pm

Works like a charm. Its awesome thanks!

By Web Dizajn, March 5, 2010 @ 2:48 pm

Thanks, I believe this should be very helpful info!

By Mercool McCaber, March 14, 2010 @ 8:54 am

Thanks, this is a different way of looking at the magento speed problem, and some useful advice – I have to admit to not having looked at this despite gzip having come to my aid in the past with non-Magento problems. I agree that the automatically generated pages are quite verbose and in my case I would expect them to compress very well with noticeable improvements in response time. Thanks again for the advice, combined with the many other tricks I think my site should soon be very zippy (groan!) indeed!

Source