473,608 Members | 2,479 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

converting ms access database to mysql 5 database

I've imported a ms access database into a table in a mysql database.
The access database contains a field that holds date/time values in
'general date' format. These all show up at 01/01/1970 in the mysql
database. I believe the field in mysql is wanting UTC and shows
numbers when looked at from the sql command line (i.e. March 13, 2006,
5:31 pm is shown as 1142289086). How do I get the access data into
that format so it will import properly?

Thanks for any help

Mar 13 '06 #1
4 3319
On 13 Mar 2006 in mailing.databas e.mysql, Dan Lewis wrote:
I've imported a ms access database into a table in a mysql database.
The access database contains a field that holds date/time values in
'general date' format. These all show up at 01/01/1970 in the mysql
database. I believe the field in mysql is wanting UTC and shows
numbers when looked at from the sql command line (i.e. March 13, 2006,
5:31 pm is shown as 1142289086). How do I get the access data into
that format so it will import properly?


MySQL standard date format is yyyymmdd.

http://dev.mysql.com/doc/refman/4.1/...ime-types.html

--
Joe Makowiec
http://makowiec.org/
Email: http://makowiec.org/contact/?Joe
Mar 14 '06 #2
"Dan Lewis" <wa********@gma il.com> wrote in message
news:11******** **************@ i39g2000cwa.goo glegroups.com.. .
I've imported a ms access database into a table in a mysql database.
Have you checked out the MySQL Migration Toolkit, which is supposed to help
with this task?
http://dev.mysql.com/doc/migration-t.../en/index.html
The access database contains a field that holds date/time values in
'general date' format. These all show up at 01/01/1970 in the mysql
database.
Sounds like the values were truncated to zero during the import. This
stores the value 0 relative to the UNIX time epoch (1970-01-01 00:00:00
UTC).
I believe the field in mysql is wanting UTC and shows
numbers when looked at from the sql command line (i.e. March 13, 2006,
5:31 pm is shown as 1142289086).
I'm not sure what you mean here. MySQL is supposed to adjust time values
when you enter them, according the timezone you have configured for the
mysqld server or a per-connection timezone override. Then time values are
stored in UTC, and adjusted back to the server or connection timezone during
queries.
How do I get the access data into that format so it will import properly?


MySQL date values must be strings in a limited number of specific formats,
e.g. 'YYYY-MM-DD HH:MM:SS'. See
http://dev.mysql.com/doc/refman/5.0/en/datetime.html for the legal formats.

You either need to export the data from MS Access in a MySQL-compatible
format, or else use the STR_TO_DATE function in MySQL to parse the MS Access
date strings into a valid MySQL date format. For example:

INSERT INTO myTable (dateField)
VALUES ( STR_TO_DATE('Mo nday, March 13, 2006', '%W, %M %e, %Y') );

See docs for DATE_FORMAT and STR_TO_DATE here:
http://dev.mysql.com/doc/refman/5.0/...functions.html

Regards,
Bill K.
Mar 14 '06 #3
I just found out that the mysql database is storing (actually, the
program that uses the db is storing) the date in epoch (unix date)
format in a long int field in the database. I've tried converting the
access field to a long int, but that didn't resolve the problem. How
do I convert a 'general date' formatted field to epoch? Will the MySql
migration kit do this? I loaded this, but didn't see how to map fields
from the source to fields in the destination.

TIA

Mar 14 '06 #4
"Wayne" <wa********@gma il.com> wrote in message
news:11******** **************@ e56g2000cwe.goo glegroups.com.. .
I just found out that the mysql database is storing (actually, the
program that uses the db is storing) the date in epoch (unix date)
format in a long int field in the database. I've tried converting the
access field to a long int, but that didn't resolve the problem. How
do I convert a 'general date' formatted field to epoch?


See the UNIX_TIMESTAMP( ) function on page
http://dev.mysql.com/doc/refman/5.0/...functions.html.

Migrating data from one RDBMS system to another is often tricky. It may be
necessary to migrate the data into an interim table (comprised mostly of
VARCHAR columns), and then use various transformations and SQL functions to
get the values into the correct format for your final destination table.

Regards,
Bill K.
Mar 14 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1288
by: Mike Doanh Tran | last post by:
Hi all, Does anyone have any suggestion for converting a Sequel database to MYSQL? I just want to copy a Sequel database data to a Mysql one. Thanks in advance for any suggestion, Mike --
17
2882
by: chicha | last post by:
Hey people, I have to convert MS Access 2000 database into mysql database, the whole thing being part of this project I'm doing for one of my faculty classes. My professor somehow presumed I knew db's and gave me long list of things to do with that particular database, first thing being that particular conversion. Truth is that I don't know a first thing about db's, let alone using mysql... I downloaded mysql form www.mysql.com and...
2
1884
by: John | last post by:
I'd love to hear some expert opinion on my situation. My department relies on Excel as a database, which causes crashing due to resource depleting and basically is just too slow. For example, a user must open seven Excel workbooks so that each can lookup values in the other to rollover into a separate "summary" workbook. Obvious problems there. What is your opinion on how this SHOULD be configured? They suggest using Access initially,...
7
8679
by: RCS | last post by:
Okay, a rather 'interesting' situation has arisen at a place I work: I need to convert a database from Access to something that can be used over the web. I am currently maintaining and developing a mid-sized Access database (60 tables, 25 simultaneous users). Although I've been tossing up if I should try to convert the back end to SQL server (We have a license), the performance has been good enough that it always seemed a waste of time,...
15
4589
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to communicate with a MySQL database table on a web server, from inside of my company's Access-VBA application. I know VBA pretty well but have never before needed to do this HTTP/XML/MySQL type functions.
4
3306
by: Bob Alston | last post by:
Anyone have experience with converting an access app from Jet database to Mysql? I am specifically looking for any changes I would have to make to my access forms, queries, modules, vba code, etc. I understand there are some data format differences in text field types and date types that need to be addressed if converting from Jet to Mysql. But other than things that have to be addressed when converting, what other changes must I make?...
8
2226
by: Michael B. Trausch | last post by:
I was wondering if anyone has had any experience with this. Someone I know is trying to move away from Microsoft Works, and I am trying to look into a solution that would convert their data in a lossless fashion to a more modern format. The database has more than 65K rows, so converting it to be an Excel spreadsheet, would, AFAIK, not be an option. It would seem that MS Works can export the database as a DBF format database, though I...
28
3569
by: Randy Reimers | last post by:
(Hope I'm posting this correctly, otherwise - sorry!, don't know what else to do) I wrote a set of programs "many" years ago, running in a type of basic, called "Thoroughbred Basic", a type of business basic. I need to re-write it, bring it kicking and screaming to run on Windows XP. This is for a video rental place, tracks movie and game rentals, customers, employee transactions, reservations, does reports,..... and on. I know some of...
4
5724
by: --CELKO-- | last post by:
I need to convert a bunch of DB2 triggers to Oracle. Is there any kind of tools for this?
0
8000
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8470
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8145
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8330
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5475
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3960
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2474
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1328
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.