Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Installing time zone support in MySQL on Windows

From: MySQL Essential Training

Video: Installing time zone support in MySQL on Windows

In this movie I'll show you how to install time zone support on MySQL on Windows. And then I'm going to come over here, in the And that should do it.

Installing time zone support in MySQL on Windows

In this movie I'll show you how to install time zone support on MySQL on Windows. My SQL supports time zones by using the extensive time zone database maintained by the IANA. That's the internet assigned numbers authority. This database is a standard set of international time zone rules, names and locations. If you're using a Mac or a Unix based My SQL installation, you probably already have this database installed. If you're using Windows, it's probably not installed by default.

In this movie, I'll show you how to install it. This is necessary if you want to learn about the time zone capabilities of MySQL. I'll be using this in the lessons on date and time types and functions. First, let's find out if this machine has time zone support installed. So I'm here in SID. And, I don't need a database selected for this. I'm just going to type in a couple of commands. First is, SHOW VARIABLES, and the word LIKE. And you'll learn, a lot of this SQL syntax later in this, course.

Show variables is a MySQL specific. It's not standard SQL, but it's part of how we manage MySQL. So I've got a single quote and a percent sign and time_zone and another percent sign and a single quote. So this will look for all the variables that have the word timezone with an underscore in the middle in the variables. And then I'm just going to say select now with. Parentheses and a semicolon. And that'll show the current date in whatever time zone is set.

So, I'm going to press Go. And we see our variables with time zone system. Time zone is set to U.S. Mountain Standard Time. That is probably something else on your system, and that's fine, that's what it's supposed to look like. It's just supposed to be set to wherever your system is and then time zone by itself without the word system in front of it. Here's set to system which means it's set to the same as the system time zone, and that is actually not correct. It should say UTC as in universal time coordinated.

That's the standard universal time. And so now shows the time here in U.S. Mountain Standard Time, which is not really what we're looking for here. So, just make sure and to show what the error is. And to be able to confirm that we fixed it after it's fixed. I'm going to type a couple. More commands here. I'm going to say, set time_score. With an underscore like that. Just as it's spell down here. Set timezone equals and in single quotes, I'm going to type US and a slash, and the word eastern with a capital e.

And another single quote and a semicolon. And then I'm going to come and copy and paste these down there. So I have those again. Now, this line here should generate an error if we don't have the time zone database installed. So I'm going to press go. And there's our error. Unknown or incorrect time zone, U.S. Eastern. And that will work after we fix this problem. You see that the time down here is the same as the time up there. And after we fix this problem those will show differently. So, I'm going to go ahead and I'm going to stop my SQL on this system.

So I have the XAMPP Control Panel, and I'm going to stop my SQL. Just press the Stop button there. And then I'm going to come over here, in the browser you notice I have this page loaded up. This is dev.mysql.com/downloads/. Timezones.html and it looks like this. This is where you download these time zone tables from and so just click on this link and download it. I've already downloaded it to my desktop, and so here it is. And it's this zip file so.

I right click on it, and select extract all and just let it extract to the default which will be right on the desktop, and I get this folder here that says, time zone 2011 and pauses. There may be a later version by the time you're doing this and that's fine. But it looks like this has all these files in it. There's three for each table, FRM, MYD, and MYI for. Each table. And there are looks like five tables here. Just going to select all of this.

And we're going to copy it into the MySQL database folder. So here I have C:/zampp/ open. And I'm going to open under that MySQL. And data and then my SQL and this is the my SQL system tables and if you scroll down here you may or may not see some time zone tables. These may be here these may not be here. In this case they are here and you'll notice that their size is very very small.

That just means they're place holders. That's find we're going to copy these new ones over them. And I'm just going to arrange these windows here to make this easy to do. And so I'm holding down the control key as I copy them. And I'm going to grab them over here it says copy to MySQL and replace the files in the destination. And that should do it. That should actually be all that's necessary to install these timezone tables. So now I start MySQL again. And I come back over here to the browser and come back over to SID, and I already have this command in here.

If I just press Go, this should just work. And there it is. The error is gone, and you notice in our results here. You notice UTC, there in the first query. That means that SID was able to initialize it's own time zone. Before, it couldn't because UTC wasn't in the time zone tables. And you notice that after we set time zone equals US eastern, now it says US eastern. And that this time and this time are not the same. Of course if you're in the eastern time zone, you may have already had.

Eastern. You can always set this to Pacific. You can type Pacific like this. Course these two times won't be the same because we have UTC now for that one. But, I press go here and now we have Pacific down here. So you can try them both and these times'll be different. This one is UTC. And this one is in Pacific now or Eastern if we type Eastern here. So, you have now successfully installed the MySQL timezone database on your Windows system.

Show transcript

This video is part of

Image for MySQL Essential Training
MySQL Essential Training

60 video lessons · 7126 viewers

Bill Weinman
Author

 
Expand all | Collapse all
  1. 4m 22s
    1. Welcome
      1m 3s
    2. Using the exercise files
      1m 31s
    3. What is MySQL?
      1m 48s
  2. 45m 37s
    1. Installation overview
      3m 16s
    2. Installing XAMPP on Windows
      5m 55s
    3. Installing XAMPP on the Mac
      6m 38s
    4. Setting up MySQL users
      11m 31s
    5. Installing SID on Windows
      5m 43s
    6. Installing SID on the Mac
      6m 6s
    7. Installing time zone support in MySQL on Windows
      6m 28s
  3. 45m 43s
    1. The SELECT statement
      3m 57s
    2. Selecting rows
      4m 57s
    3. Selecting columns
      3m 8s
    4. Sorting results with ORDER BY
      2m 58s
    5. Filtering results with WHERE
      3m 52s
    6. Filtering results with LIKE and IN
      3m 41s
    7. Filtering results with regular expressions
      8m 21s
    8. Inserting rows
      4m 9s
    9. Updating rows
      2m 21s
    10. Deleting rows
      2m 25s
    11. Literal strings
      3m 12s
    12. Understanding NULL
      2m 42s
  4. 41m 47s
    1. Creating a database
      4m 30s
    2. Creating a table
      7m 18s
    3. Creating indexes
      6m 8s
    4. Controlling column behavior with constraints
      4m 46s
    5. Creating an ID column
      6m 58s
    6. Using foreign key constraints
      7m 58s
    7. Altering a table
      4m 9s
  5. 28m 56s
    1. What are data types?
      4m 1s
    2. Numeric types
      5m 21s
    3. String types
      2m 58s
    4. Date and time types
      7m 2s
    5. Bit type
      2m 26s
    6. Boolean values
      2m 15s
    7. Enumeration types
      4m 53s
  6. 32m 34s
    1. String functions
      6m 57s
    2. Numeric functions
      6m 2s
    3. Date and time functions
      4m 12s
    4. Time zones in MySQL
      3m 37s
    5. Formatting dates
      1m 51s
    6. Aggregate functions
      5m 45s
    7. Flow control with CASE
      4m 10s
  7. 7m 6s
    1. Maintaining database integrity with transactions
      4m 46s
    2. Using transactions for performance
      2m 20s
  8. 16m 49s
    1. Updating a table with a trigger
      5m 11s
    2. Preventing automatic updates with a trigger
      7m 29s
    3. Logging transactions with a trigger
      4m 9s
  9. 14m 11s
    1. Creating a simple subselect
      3m 23s
    2. Searching within a result set
      3m 53s
    3. Creating a view
      3m 32s
    4. Creating a joined view
      3m 23s
  10. 12m 26s
    1. Understanding MySQL stored routines
      2m 0s
    2. Creating a stored function
      4m 34s
    3. Creating a stored procedure
      5m 52s
  11. 14m 4s
    1. The multi-platform PDO interface
      3m 44s
    2. Executing the SQL
      4m 8s
    3. Implementing auto-increment IDs
      2m 3s
    4. Using a stored funciton
      4m 9s
  12. 1m 3s
    1. Goodbye
      1m 3s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed MySQL Essential Training.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.