4

I have written a module that is refusing point blank to create the tables within my mysql4-install-1.0.0.php file....but only on the live server.

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

So based on the fact that the files are the same can I assume that it is a server configuration and or permissions problem? I have looked everywhere and I can find no problems in any of the log files (PHP, MySQL, Apache, Magento).

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

Anyone see this before?

Thanks

** EDIT ** One main difference between the 2 environments is that on the live server the MySQL is remote (not localhost). The dev server is localhost. Could that cause issues?

2
  • Can you add other modules, e.g. the developer toolbar or something else known not to screw up a system? If so then the problem is with your module not the setup of MySQL etc. Commented Jun 30, 2011 at 15:53
  • Later versions of Magento (1.6+ I think) look for an install-1.0.0.php file, rather than a mysql4-install-1.0.0.php file. Commented Mar 3, 2014 at 14:31

5 Answers 5

5
  1. Is the module which your install script is a part of installed on the live server? (XML file in app/etc/modules/, Module List Module for debugging.)

  2. Is there already a record in the core_resource table for your module? If so, remove it to set your script to re-run.

  3. If you file named correctly? The _modifyResourceDb method in app/code/core/Mage/Core/Model/Resource/Setup.php is where this file is include/run from. Read more here

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Alan. 1) Yep, I’m confident that all the required module files are installed correctly on the live server (as it is replicated from the dev server). 2) I am removing the listing in the db to test. 3) I will have a look at this function and debug. Thanks
3

Probably a permissions issue - a MySQL account used by public-facing code should have as few permissions as possible that still let it get the job done, which generally does NOT allow for creating/altering/dropping tables.

Take whatever username you're connecting to mysql with, and do:

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

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

show grants for username@host;

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

3 Comments

Thanks for the reply. The live system has GRANT ALL for my user so I guess the MySQL permissions are more than enough. Thanks though.
I think this is off the mark because Magento uses its own connector to access the database.
Doesn't matter how magento connects, if it's a permissions issue, then this is how you'd compare the permission sets between the two systems. Just because magento has its own connector doesn't mean it can magically bypass the MySQL grant system.
1

In the Admin->System->Advanced section is your module present and enabled?

Did you actually unpack your module to the right space, e.g. app/code/local/yourcompany/yourmodule ?

Do you have app/etc/modules/yourmodule.xml - I believe that this could be the overlooked file giving rise to your problem.

2 Comments

Thanks for the reply. Yes everything appears to unpack correctly and the module appears in the admin correctly. As mentioned the file structure is identical to the dev server and it installs correctly on that. Thanks.
Is it registered already? Open phpmyadmin and search for your module name. It will be in a config table, just the one key. Take it out and then it should magically install itself.
1

the cache could be the culprit, if you manually deleted the core_resource row for your module in order to make the setup sql run again, you have to also flush the cache

probably a difference between dev and production servers is cache settings, that would explain why you only see this in production

Comments

0

For me, the issue appeared using Windows for development. Linux system is case sensitive. In my config.xml the setup section was named camelCase while the folder was named all-lowercase. Making them the same made the script run.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.