SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySQL/phpMyAdmin Help

    1) Having a problem when manually entering .sql file contents thorugh paste/copy using my ISP's phpMyAdmin.

    It has happened in last four or five times i've tried to manually "transfer" .sql file content so that tables and data can be set up under my database.

    -------------------------
    2) This last time, i was testing "phpSiteAdmin." I copied and pasted contents of .sql file through phpMyAdmin and received following error:

    MySQL said:

    You have an error in your SQL syntax near '\'0\',
    name varchar(50) NOT NULL default \'\',
    file varchar(200) NOT NULL ' at line 3

    ------------------------
    3) I posted a message for developer to see if help could be provided, and he replied:

    Sounds like its a problem with your MySQL. No one has reported a problem with the SQL included.

    MySQL 4.x is not a production application, as far as I know it is still in alpha stage testing. PSA will not support it until it has been declared stable for at least 60 days.

    -----------------------
    4) Having done this in the past, i again contacted my ISP to see if they could help.

    My apologies for the delay. I think this is really a mysql syntax error rather than an error with our server or its configuration but though Im not an expert in mysql Id be happy to help as best I can.

    I was wondering why you have the create table statement like this

    CREATE TABLE sections (
    ID INT(10) UNSIGNED \'1\' NOT NULL AUTO_INCREMENT,
    section varchar(255),
    PRIMARY KEY (ID)
    );

    rather than this

    CREATE TABLE sections (
    ID INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
    section varchar(255),
    PRIMARY KEY (ID)
    );

    what is the role of "\'1\'" after "UNSIGNED" If you take this out then the
    table is created without error am I am not sure what the purpose of it is.

    Let me know if it is essential or its purpose and perhaps I can help further in
    solving the problem - as it is I think that may be the error.

    Thanks
    -----------------------------
    5) After reviewing the previous .sql files, i did find that they had the '1' in place and that might have caused the problem.

    Does this mean that all those scripts or .sql files have beend programmed incorrectly? Or, does my ISP have its phpMyAdmin settings or even the MySQL set up in a way that causes me to receive these problems.

    My ISP is asking why don't i just delete that part of the code and it should work. Well, i attempted to do that and i still received some similar errors.

    For this technical questions, would appreciate helpful information:
    Has someone had this type of problem?
    Does anyone have knowledge as to the error cause?

    This being my first post, i hope i have made myself understood.

    My web server runs using:

    Apache 1.3.20
    PHP 4.2.1
    MySQL 3.23


    Thanks.
    Last edited by Mr_H; Aug 16, 2002 at 15:33.

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2002
    Posts
    180
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i get the same error (win xp/iis 5.0 with .net 2.0/php 4.2.2/mysql 3.23.51-nt/phpMyAdmin 2.2.6-rc2) just removing the \'1\' made it work fine though.

  3. #3
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm assuming you used phpmyadmin to generate the .sql file? Phpmyadmin isn't too great at it, and you're better off using mysqldump to do it all.

    Basically use mysqldump on your local machine with:

    PHP Code:
    mysqldump --opt database_name nameoffile.sql 
    then FTP it somewhere to your webspace and go

    PHP Code:
    mysqldump database_name < /absolute/path/to/file.sql 
    [this is done in the shell BTW, and to find out the absolute path type pwd at it].

    HTH
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  4. #4
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Follow up

    Thanks weirdbeardmt.

    I've been having trouble, not so much with use of shell scripts/software, but, especifically with WHERE within the shell application am i to ENTER such commands. So, i thought use of phpmyadmin would solve my problems. And, then again, maybe not.

    Sorry about the type of inquiry, but i'm new to to this PHP MySQL. In above explanation, i gather that both php commands to database are given using SHELL, "AFTER" one connects to server, right?

    It is mentioned above to use mysqldump ON YOUR LOCAL MACHINE with the given command. So, at which point is that command typed in, in local machine means before you use shell to connect?

    Sorry to place such a question that to some may seem simple, but, is not so simple to me at this time.

    I've just downloaded WINSPC2, and will try to find WHERE it is that one types in the commands. I seem to be unable to find WHERE to enter such commands with previous software i've tried.

    Anyways, let's see what happens. Again, thanks for the feedback in here. Look forward to more visits, and learn more as time goes by.

    Adios.
    Last edited by Mr_H; Sep 13, 2002 at 14:24.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •