Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Mysql database problem

Mysql database problem

Scheduled Pinned Locked Moved Database
helpphpdatabasemysqlsysadmin
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 13723066
    wrote on last edited by
    #1

    Hi Everyone, so i have a problem with my MySQL database, whenever i try to import the database i get an error that says

    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

    I was running a site and using VestaCP i wanted to reinstall my server, so i simply exported the database from PHPmyAdmin and then reinstalled the whole server. Then again i installed VestaCP and now when i am trying to import the Database i get the following error

    ERROR 1064 (42000) at line 31734: 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 ''C:24:"WPSEO_Sitemap_Cache_Data":152414:{a:2:{s:6:"status";s:2:"ok";s:3:"xml";s:' at line 2

    It is a wordpress database, i really have no clue as to whats happening. If you guys can help me out i'd appreciate it. I read some articles on Google, and i think its related to the Mysql or PHp versions. But i couldn't find answers or threads specifically for this issue. So please help me out ASAP because my website is down from days. Thanks

    A J 2 Replies Last reply
    0
    • U User 13723066

      Hi Everyone, so i have a problem with my MySQL database, whenever i try to import the database i get an error that says

      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

      I was running a site and using VestaCP i wanted to reinstall my server, so i simply exported the database from PHPmyAdmin and then reinstalled the whole server. Then again i installed VestaCP and now when i am trying to import the Database i get the following error

      ERROR 1064 (42000) at line 31734: 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 ''C:24:"WPSEO_Sitemap_Cache_Data":152414:{a:2:{s:6:"status";s:2:"ok";s:3:"xml";s:' at line 2

      It is a wordpress database, i really have no clue as to whats happening. If you guys can help me out i'd appreciate it. I read some articles on Google, and i think its related to the Mysql or PHp versions. But i couldn't find answers or threads specifically for this issue. So please help me out ASAP because my website is down from days. Thanks

      A Offline
      A Offline
      A_Griffin
      wrote on last edited by
      #2

      Can you not post the full SQL? But I suggest you look at the second of the first pair of apostrophe's, which on the face of it should either not be there or be escaped.

      U 1 Reply Last reply
      0
      • A A_Griffin

        Can you not post the full SQL? But I suggest you look at the second of the first pair of apostrophe's, which on the face of it should either not be there or be escaped.

        U Offline
        U Offline
        User 13723066
        wrote on last edited by
        #3

        You are taking about these

        ''C:24

        apostrophes? i just have to remove this from the sql file and upload it? I cant post the full sql file because its 1 GB and very very large.

        A V 2 Replies Last reply
        0
        • U User 13723066

          You are taking about these

          ''C:24

          apostrophes? i just have to remove this from the sql file and upload it? I cant post the full sql file because its 1 GB and very very large.

          A Offline
          A Offline
          A_Griffin
          wrote on last edited by
          #4

          Quote:

          just have to remove this from the sql file

          Not necessarily, it depends on what comes before it - if those are just two apostrophe's on their own in the middle of a longer statement they're fine, and the problem lies elsewhere. BUT you shouldn't really be posting strings in an SQL statement anyway - it's a security risk; look into paramatised queries instead And they are far less prone to syntax errors

          1 Reply Last reply
          0
          • U User 13723066

            You are taking about these

            ''C:24

            apostrophes? i just have to remove this from the sql file and upload it? I cant post the full sql file because its 1 GB and very very large.

            V Offline
            V Offline
            Victor Nijegorodov
            wrote on last edited by
            #5

            Member 13755227 wrote:

            I cant post the full sql file because its 1 GB and very very large.

            1 GB? :confused: I thought the limit is about 1 Mb...:confused:

            J 1 Reply Last reply
            0
            • V Victor Nijegorodov

              Member 13755227 wrote:

              I cant post the full sql file because its 1 GB and very very large.

              1 GB? :confused: I thought the limit is about 1 Mb...:confused:

              J Offline
              J Offline
              jschell
              wrote on last edited by
              #6

              What limit are you talking about? A 1 meg database would be pretty small these days.

              V 1 Reply Last reply
              0
              • U User 13723066

                Hi Everyone, so i have a problem with my MySQL database, whenever i try to import the database i get an error that says

                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

                I was running a site and using VestaCP i wanted to reinstall my server, so i simply exported the database from PHPmyAdmin and then reinstalled the whole server. Then again i installed VestaCP and now when i am trying to import the Database i get the following error

                ERROR 1064 (42000) at line 31734: 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 ''C:24:"WPSEO_Sitemap_Cache_Data":152414:{a:2:{s:6:"status";s:2:"ok";s:3:"xml";s:' at line 2

                It is a wordpress database, i really have no clue as to whats happening. If you guys can help me out i'd appreciate it. I read some articles on Google, and i think its related to the Mysql or PHp versions. But i couldn't find answers or threads specifically for this issue. So please help me out ASAP because my website is down from days. Thanks

                J Offline
                J Offline
                jschell
                wrote on last edited by
                #7

                Member 13755227 wrote:

                at line 2

                So right at the top of the file. The error message certainly seems to suggests that the imported file is NOT sql. If you export a database using process X then you must import it using process X also. Because the export and import can use a format specific to that process and not a general one.

                1 Reply Last reply
                0
                • J jschell

                  What limit are you talking about? A 1 meg database would be pretty small these days.

                  V Offline
                  V Offline
                  Victor Nijegorodov
                  wrote on last edited by
                  #8

                  jschell wrote:

                  What limit are you talking about? A 1 meg database would be pretty small these days.

                  The SQL file. I meant a limit for SQL query, not a limit of the database itself. If I incorrectly understood the OP then sorry!

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups