#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Web Developer
    Posts
    6
    Rep Power
    0
    Hi, dear friends, i was going to transform the M.S.Access database into MySQL format and now I have got the text file which is full of 'INSERT()' SQL statement already. Now the question is how to execute the statements file in MySQL?

    I tried some windows-shared version of MySQL, there is a command named "source", which can execute a statements file easily. But with the version provided by my ISP, i can not find out that command? I think there should be some ways to do it. but how?

    Then I tried to create the DB structure in MySQL firstly and exported the M.S.Access database into "tab eliminates" or "commar eliminates" files or something like that, then I tried to use "load" command in MySQL,
    like: load data infile '****' into table ***, but the error mesag is "ACCESS DENIED FOR USER: ****@LOCALHOST (USING PASSWORD: YES)"

    so what does it mean? what is the comman way after you guys get the query statemenets file from some converting program?

    Sorry to bother you, thanks a lot.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    29
    Rep Power
    0
    One way of moving data from Access to MySQL is by creating an ODBC connection between the two databases. If you have already created the tables in MySQL it is then very easy to write Access append queries to populate them. There are many good articles on the web about how to do this.

    You will need to start by downloading MyODBC from the php site.
  4. #3
  5. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,642
    Rep Power
    4476
    If your file is all INSERT statements, then it's real easy to get it into mysql. First make sure the database and table are created in mysql to hold the data. then just use:
    mysql -uuser -p database < yourfilename

    sometimes the files have the create definetion for the table in them, also. if it does, then all you have to do is create the database. hope that helps.

    ---John Holmes...
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Web Developer
    Posts
    6
    Rep Power
    0
    Thanks so much, it is working very well!

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by SepodatiCreations:
    If your file is all INSERT statements, then it's real easy to get it into mysql. First make sure the database and table are created in mysql to hold the data. then just use:
    mysql -uuser -p database < yourfilename

    sometimes the files have the create definetion for the table in them, also. if it does, then all you have to do is create the database. hope that helps.

    ---John Holmes...
    [/quote]

Similar Threads

  1. if/ else statement in .inc file
    By tragnark in forum PHP Development
    Replies: 3
    Last Post: February 9th, 2004, 12:22 PM
  2. Preparing SQL file for do()ing.
    By cparker in forum Perl Programming
    Replies: 3
    Last Post: February 6th, 2004, 11:29 PM
  3. MySQL to MS SQL 2000
    By diskord in forum MySQL Help
    Replies: 0
    Last Post: February 6th, 2004, 07:00 PM
  4. (hopefully) simple SQL in java servlet question
    By djstyli in forum Java Help
    Replies: 3
    Last Post: February 5th, 2004, 07:58 PM
  5. C++ reading file question
    By tmike in forum C Programming
    Replies: 1
    Last Post: February 3rd, 2004, 02:06 AM

IMN logo majestic logo threadwatch logo seochat tools logo