Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I just installed the Date module on my local system where I'm running MAMP. When I try to turn on the Date module I receive the following message:
"(Currently using Date database requirements The Date module requires a database that has timezone support enabled, and your database does not. See [link]MYSQL Timezone Information[/link] for more information.)"
I've read the information provided in the link and have learned that the time zone variable on MAMPs version of mysql is set to System, so basically I'm at a loss.
Any help would be appreciated.
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#6 | time_zone.sql_.txt | 887.06 KB | RobLoach |
Comments
Comment #1
vanderlip CreditAttribution: vanderlip commentedI have the same issue. PHP 5.2.5. Shared hosting on Linux.
Comment #2
jastraat CreditAttribution: jastraat commentedIn mysql, there's a database called mysql that contains (or needs to contain) some timezone-related tables.
To fix this problem, I ran some commands at the command line.
" again. You should have more than 500 rows now.
Comment #3
vanderlip CreditAttribution: vanderlip commentedJastraat -
Thanks a lot for your help! Unfortunately, I don't have shell access to my host. Can the same be accomplished using the phpmyadmin interface?
Thanks
Comment #4
jastraat CreditAttribution: jastraat commentedI'm afraid I don't know... This was the first time I had heard of anything like this as well! The sql checks could certainly be done through phpMyAdmin as long as your login can read the mysql database, but I doubt you'd be able to load the timezone tables.
Comment #5
vanderlip CreditAttribution: vanderlip commentedThanks again, you are right. I was able to do the SQL checks but not load the tables. Maybe someone else can chime in with a different solution.
Comment #6
RobLoachThanks for the information, jatraat. If you head over here, you'll find the time_zone tables that you need if you can't get it through
./mysql_tzinfo_to_sql /usr/share/lib/zoneinfo | /usr/local/mysql/bin/mysql -p -u root mysql
.The attached file is a MySQL dump of the insert rows. This does not hold the create table statements as most MySQL database installations already have the mysql.time_zone tables, just not the rows. You have to run this SQL file on the mysql database that has the time_zone tables.
Comment #7
intent CreditAttribution: intent commentedThanks jastraat.
My table is empty. Unfortunately, I'm still facing two problems:
1. Since I'm using MAMP, I'm guessing the path following the "|" in your command needs to change, but I'm not precisely sure what it needs to change to
2. No matter what I try to use for a path, I'm getting an "ERROR 1064 - You have an error in your SQL syntax..." message - very frustrating
Rob, on the mysql documentation page you reference, it specifically says not to load these tables if you have timezone files on your system. I do have timezone files on my system. Do you know if this will cause any actual problems?
Thanks for everyone's help with this.
Comment #8
rjleigh CreditAttribution: rjleigh commentedI had this problem too on my dev server. I look and the time_zone_name table is empty, so I downloaded and installed the timezone info from the link on the status page. Still an error, and after a little digging I remembered that the drupal data user only has permissions for the drupal database. When I changed the 'select' permission for that user and the `mysql` table, the error vanished.
But here's the thing - I have clients that are on managed servers, and there won't be access to that mySQL table, which is essential to the date_api_sql.inc test:
THIS IS A HUGE SECURITY ISSUE! As a matter of course, even when I have the control of the server, I don't want any limited user to have access to the `mysql` table.
In fact, especially since the username and password of the drupal user are stored in plaintext in the settings file, I would limit the permissions as much as possible.
Now, I'm not at all up to speed on this update (that just what I was starting to do), but I think it's only this test that asks for that direct access.
Why not just have the second test, which tries a conversion?:
I tried this on a managed server just in sql calls - I couldn't access the table in the first test but I was able to run the second convert test successfully.
(these tests actually overlap in the version I have - I separated them for clarity).
Is there any other need for privileges outside of the drupal db?
Comment #9
KarenS CreditAttribution: KarenS commentedI've been making an assumption that the timezone tables will be installed on actual web hosts, including inexpensive shared hosts. They are not installed on Windows by default, so anyone using Windows as a local development environment will need to install them, but that is very easy to do in Windows (download the files and drop them in the mysql/data/mysql folder). I don't know what MAMP does, if the tables are populated or not.
The other question is the right way to test whether that capability is there. Maybe I've made the test more difficult than it needs to be.
Anyway the goal is that this would not be something your average end user would have to do anything with. I certainly wouldn't expect anyone to try to do something with the tables on a shared host.
So any help figuring out the following would be helpful:
1) Do common, inexpensive, shared hosts have the timezone tables populated so we can count on having them available and use them?
2) What is the best way to test whether they are there?
Comment #10
KarenS CreditAttribution: KarenS commentedI just committed change to cvs to simplify the test to the one that worked in #8. If that returns true, you definitely have timezone support. If it returns false, you may have timezone support with tables that are outdated (which would still work but sometimes be off) or you might not have any timezone support. Let's see how this one works.
Comment #11
gustav CreditAttribution: gustav commentedBesides the issue of whether the tables are there there is the issue of whether the database user has been given select access to them. If one just creates a new user on the MySQL server then this access is not there automatically but has to be explicitly granted.
Comment #12
KarenS CreditAttribution: KarenS commentedI just need 'CONVERT_TZ(...)' to work. I don't think any special permission would be needed for that. That is what #8 alluded to above, that I have to get rid of the first test, which might require permissions, which is what I did in my last commit.
Comment #13
rjleigh CreditAttribution: rjleigh commentedRight, exactly my point. The 'CONVERT_TZ(...)' is enough of a test, and requires no special permissions. The first test will always fail just because of permissions on most hosted systems.
And I don't see anything else in your code that should be a problem, at least on first scan.
Thanks.
Comment #14
KarenS CreditAttribution: KarenS commentedThe changes to the test have been committed, and I also added more explanation to INSTALL.txt about the database timezone.
Please let me know if it turns out that common shared hosts do not have the timezone information loaded in the database, I'm still assuming that they will.
Comment #15
anthonym CreditAttribution: anthonym commentedHi.
Some questions: Just installed the latest Date module and I get the following message on my status report page:
The Date Timezone module requires a database that has timezone support enabled, and your database does not. See MYSQL Timezone Information for more information.
I've read through this whole thread, but there is something fundamental I don't understand. In which database exactly are the timezone tables supposed to be: my drupal database? or some system-wide database that I probably don't have permission for? My site is hosted on bluehost.
Comment #16
rjleigh CreditAttribution: rjleigh commentedThe timezone information resides in a system database, not the drupal db.
If you're using the latest date 5.x-2.x-dev version (dated Feb 9), the testing problem described here has been fixed, so the problem is probably in the server config - either the timezone info is outdated or simply not there.
If you're trying to explain things to the host's tech support, just use this info:
The test is a simple SQL call that can be executed at the mySQL command line or in something like phpmyadmin:
and the return should be
Refer them to this:
http://dev.mysql.com/doc/refman/5.0/en/time-zone-support.html
most likely, they will have to run this command with mysql (and perhaps linux) root privileges:
or load the timezone data from http://dev.mysql.com/downloads/timezones.html
Comment #17
rjleigh CreditAttribution: rjleigh commentedJust to give a little more info to those who don't know Linux well; checking this on the myriad client systems I manage, I found a Red Hat installation that also had empty timezone tables (mysql 4.1).
There the mysql_tzinfo_to_sql file was not in the path, but was found at:
/usr/local/mysql/bin/mysql_tzinfo_to_sql
and I did NOT need linux root privileges to run it (but still needed mysql rights to the mysql table).
Of course, if you want to test the working of the util BEFORE you pipe it into the mysql system, just run
mysql_tzinfo_to_sql /usr/share/zoneinfo
Comment #18
djorn CreditAttribution: djorn commented@Karen: I don't know if Site5 is considered a major host, but I can say that they refused to install the timezone tables when I filed a support ticket with them. I've moved on to a new host who was more than willing to make this change for me though so no problem here for my site. If the new method is faster, then I think it's worth the tradeoff of having to find a host who is willing to configure their database appropriately.
Comment #19
isaac77 CreditAttribution: isaac77 commentedI disagree. And honestly, it's not just because I use site5 for several Drupal sites ;-)
If we want Drupal to grow, we cannot have a feature as important (and basic) as proper date fields depend on finding a specific host. Many potential Drupal users already have hosting. If they hit a wall with Drupal because they cannot use date fields, they'll probably move on to another framework before they go through the trouble and expense of switching hosts.
I'm sorry I don't have the expertise to contribute to fixing this problem, and I appreciate everyone's work on this.
Comment #20
KarenS CreditAttribution: KarenS commentedI was hoping that most sites would have the timezone tables installed by default. If that's not the case, I'll have to go back to doing this differently.
Too bad, because it is much better to do this in the database.
Comment #21
djorn CreditAttribution: djorn commentedI was personally surprised at site5's response since it seems like timezones are considered part of the "default" package. I hate for this module to sacrifice speed for compatibility. Would it be possible to have a module to "emulate" this timezone table (or just fall back to the old-style date handling if the select statement fails)?
P.S. Now that isaac77 mentions it, I do agree that compatibility is very important as well for adoption of Drupal.
Comment #22
djorn CreditAttribution: djorn commented@isaac77: Can you double check with one of your Site5 websites to see if your experience is the same as mine? Who knows... maybe I had something misconfigured but I would hate for decisions about this issue to hinge around a single person's report.
Comment #23
rjleigh CreditAttribution: rjleigh commentedI use Dreamhost for several nonprofits (free for 501(c) orgs - see their wiki!), and they support the timezones.
If the speed is much faster, but an alternative could be handled in PHP, maybe the test could set a system variable denoting the preferred method (but will that check eat up the time savings?).
Or, where the function is used, a return error kicks into the slower method (making it even slower for them, I guess).
Hate to slow things down when many will be able able to support this, but of course people should not have to pick a host because of a contributed module, even one as useful as this!
Comment #24
droople CreditAttribution: droople commentedHow to solve this problem on XP Pro, running Apache2Triad
Comment #25
rjleigh CreditAttribution: rjleigh commentedFor windows, download the timezones table at: http://dev.mysql.com/downloads/timezones.html
Find the directory where your mysql data is stored, and put the contents that zip into the 'mysql' folder (don't know why they didn't write an SQL statement!)
more info at http://dev.mysql.com/doc/refman/5.0/en/time-zone-support.html
Comment #26
anthonym CreditAttribution: anthonym commentedFollowing rleigh's suggestion I sent my hosting provider (bluehost) a message asking about the timezone databases. Still haven't had a reply. I will update when I do.
Comment #27
manerhabe CreditAttribution: manerhabe commentedGodaddy apparently does not have the timezone tables populated as I get this error using the latest 5.x-2.x-dev version (post Feb 9). After going back and forth trying to explain how to populate the tables to Godaddy's obviously confused support techs, they have told me I need a dedicated server to change the settings I would like myself.
I'll probably see if I can change my organization over to Dreamhost (if they support it) since its free for nonprofits. In the meantime I guess I will go back to the 5.x-1.8 version. Thanks for your continued support of this great module.
Comment #28
anthonym CreditAttribution: anthonym commentedI just received a reply to my support request (after prodding the tech support through their live chat):
My request:
Their reply:
I can't get much from this response other than that it is negative. Judging from others' reports it probably won't do much good to pursue it much further (although I might try). Would it be possible to put these timezone tables into the drupal database instead? Perhaps someone could even make them into an easy-to-install package?
Comment #29
KarenS CreditAttribution: KarenS commentedWell that last response about requiring root access means it takes root access to populate the tables, which it does, but once they are populated it should not take root access to be able to use the timezone conversion function. If they have people sharing a mysql server (which would probably be the case), they only need to populate the shared mysql database, not every single individual database on the system, so that doesn't seem like that much of a burden, but apparently it is.
It sounds like it is just not reasonable to assume that shared hosts will have this capability and know how to get things set up.
Figuring out a way to use the timezone functions when they're available and doing the timezone conversion differently when they're not is just too complex to create and manage. There are too many places in the code that this affects.
And it won't help to put the tables into the Drupal database because the timezone functions we will be using assume they are in that database you don't have access to, they can't be anywhere else.
So I guess we're back to re-writing to code to eliminate relying on those tables.
Thanks everyone for chiming in on this. I was really hoping it would turn out differently. I'm working on a fix (and looking at some of the code that ChrisRL submitted to see if I can use it).
And I need to change the status because this is *not* fixed.
Comment #30
KarenS CreditAttribution: KarenS commentedComment #31
ronaldmulero CreditAttribution: ronaldmulero commentedPerhaps a coordinated email campaign might help get more hosting providers to enable timezone support. The squeaky wheel gets the grease, after all. And in the end, I doubt that hosting providers really want to alienate their paying customers.
Here's the (automated?) response I got from GoDaddy this afternoon:
And here's the email that I originally sent them this morning:
Comment #32
KarenS CreditAttribution: KarenS commentedBased on this and the problems noted at http://drupal.org/node/220663, it appears we cannot count on being able to do timezone conversion in the database in any reliable manner, so I am rolling the Date and Calendar modules back to the code they used to use that uses offsets instead of timezone names.
I still need to roll forward and re-apply patches that came after this change, and then see what other adjustments are needed.
Comment #33
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.