Magento module does not work SQL

I wrote a module that rejects an empty point for creating tables in my mysql4-install-1.0.0.php file ... but only on a real server.

The funny thing is that on my local machine (which is a mirror of a live server (i.e. identical file structure, etc.)), the installation is performed correctly and a table is created.

So, based on the fact that the files are the same, I can assume that this is a server configuration or permission problem? I searched everywhere and I can not find any problems in any of the log files (PHP, MySQL, Apache, Magento).

I can create tables in test scripts (using core_read / write).

Has anyone seen this before?

thanks

** EDIT ** The main difference between the two environments is that on a real server, MySQL is remote (not localhost). The dev server is localhost. Could this cause problems?

+4
source share
4 answers
  • Is the module that your installation script is part of installed on a real server? (The XML file in the application / etc / modules /, Module List Module for debugging.)

  • Is there an entry in the core_resource table for your module? If so, delete it to restart the script.

  • If you entered the file name correctly? The _modifyResourceDb method in app/code/core/Mage/Core/Model/Resource/Setup.php is where this file includes / starts. Read more

+5
source

Probably the problem with permissions - the MySQL account used by open source should have as few permissions as possible, which still allow you to complete a task that usually does NOT allow creating / modifying / deleting tables.

Take any username with which you connect to mysql and do:

 SELECT User, Host FROM mysql.user WHERE User='your username here'; 

This will show you the user @host commands available for that particular username, then you can get the actual permissions with

 show grants for username@host ; 

Do this for two accounts on the live and devlopment server, which will show you what permissions are missing on the live system.

+3
source

Under Admin-> System-> Advanced, is your module introduced and enabled?

You really unpacked your module in the right place, for example. app / code / local / yourcompany / yourmodule?

You have the application /etc/modules/yourmodule.xml - I believe that this may be a missing file that creates your problem.

+1
source

the cache may be the culprit, if you manually deleted the core_resource line for your module in order to start the SQL installation server again, you also need to reset the cache

The difference between dev and production servers is probably the cache settings, which explains why you only see this during production

+1
source

All Articles