Mysql import/export problems

Discussion in 'Web Design and Development' started by barrysfarm, Jan 5, 2007.

  1. barrysfarm macrumors regular

    Joined:
    Nov 1, 2005
    #1
    Alright,

    We're moving some files to a new web host, and I'm running into some trouble. In the old host in phpMyadmin I can export the database scructure as a file, but when I import it to the new one via phpMyadmin, it gives me an error.

    #1064 - You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use
    near 'access_id` int(11) NOT NULL auto_increment,
    `access_cd` varchar(16) NOT NULL d' at line 1

    I think it has something to do with different versions of mysql or different veresion of phpMyadmin. We're moving from mysql MySQL 3.23.58 / phpMyAdmin 2.6.0-pl3 to MySQL 5.0.24a / phpMyAdmin - 2.8.2.4

    any ideas?
     
  2. 4np macrumors 6502a

    4np

    Joined:
    Feb 23, 2005
    Location:
    The Netherlands
    #2
    hmm... perhaps the SQL syntaxis has changed a little bit between these versions. I'm not sure though since I mainly use MSSQL at work (and MySQL latest at home).

    Have you tried the command line import / export utilities? Or don't you have shell access?
     
  3. barrysfarm thread starter macrumors regular

    Joined:
    Nov 1, 2005
    #3
    i have ssh access to the new host, but not the old one. Do i need access to the old one if i have the exported file already? I've never used ssh.
     
  4. 4np macrumors 6502a

    4np

    Joined:
    Feb 23, 2005
    Location:
    The Netherlands
    #4
    Probably not... you can try to ssh to the new server and import the database export you created with phpmyadmin using the command line utilities:

    Code:
    mysql -u username -ppassword database_name < FILE.sql
    
     
  5. barrysfarm thread starter macrumors regular

    Joined:
    Nov 1, 2005
    #5
    Alright, I got to this part (with the correct info):
    mysql -u username -ppassword database_name < FILE.sql

    and then it tells me all of the options i have with the mysql command. It doesn't seem to process any info or anything, and the database is the same as it was. I did upload the file to the ftp root.

    Any ideas?
     
  6. 4np macrumors 6502a

    4np

    Joined:
    Feb 23, 2005
    Location:
    The Netherlands
    #6
    what is the actual create table statement which fails?
     
  7. barrysfarm thread starter macrumors regular

    Joined:
    Nov 1, 2005
    #7
    Sorry about the delay in response.

    Here's all it get's through:

     
  8. barrysfarm thread starter macrumors regular

    Joined:
    Nov 1, 2005
    #8
    Alright, I figured it out. In the sql file that was exported, it put in a bunch of comments saying what the table name was and the new version of mysql didn't like it. Once I removed them, it all worked.

    Thanks!
     

Share This Page