Forum Moderators: coopster

Message Too Old, No Replies

Access DB To MYSQL

         

BlackRaven

3:31 am on Aug 15, 2005 (gmt 0)

10+ Year Member



hi wondering if someone could help, i need to convert an access db to mysql, how do i tell mysql to read an access file? Also the date table in the access is in a different format then in the mysql?
Acess format: Month/day/year
mysql: year:month:day
so i tried changing the date column through phpmyadmin by typing in "'%c/%e/%Y'"in the values field. However the default still shows as 000-00-00. Am i doing something wrong? thanks
Oh and am using Foxserv

BlackRaven

4:18 am on Aug 15, 2005 (gmt 0)

10+ Year Member



does anyone know how to use the mysqlimport command line? is this same as the sql query command in phpmyadmin?

coopster

2:55 pm on Aug 15, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Have you searched the forum yet? There have been quite a few discussions on Access to MySQL conversion.

[webmasterworld.com...]
[webmasterworld.com...]

Also, the MySQL manual pages have some fairly decent docs on using the import utility.

[dev.mysql.com...]

BlackRaven

6:53 pm on Aug 15, 2005 (gmt 0)

10+ Year Member



oh thanks one quick ques where do i run these commands though?
C:\> mysql mydb
mysql> LOAD DATA LOCAL INFILE 'mytable.txt'
-> INTO TABLE mytable
-> FIELDS TERMINATED BY ',' ENCLOSED BY '"'
-> LINES TERMINATED BY '\r\n';
is it the dos prompt on xp or some other program? Cause in dos prompt i get an error "mysql is nor reconignized..."

coopster

7:10 pm on Aug 15, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



On my Windows setup I have a Command Line shortcut that starts in the MySQL binary directory. When the window opens, I'm ready to start.

[webmasterworld.com...]

BlackRaven

8:27 pm on Aug 15, 2005 (gmt 0)

10+ Year Member



two ques
how do i set localhost password and user in this Command line?
mysql mydb
mysql> LOAD DATA LOCAL INFILE 'mytable.txt'
-> INTO TABLE mytable
-> FIELDS TERMINATED BY ',' ENCLOSED BY '"'
-> LINES TERMINATED BY '\r\n';

does it matter where do i put the myaccess.txt file in? can i type in

INFILE 'C:/mydocuments/myaccess.txt'

Also for those who are using Foxserv the prompt command line for mysql can be found in C:\FoxServ\mysql\bin\mysql.exe

coopster

10:34 pm on Aug 15, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You just add them to your command line as the manual pages [dev.mysql.com] suggest:
mysql -u username -p mydb

As far as the path/filename, the manual pages probably state it best:
[dev.mysql.com...]