Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Nov 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ||| Error 1102 on Windows 2000 Pro hell!! |||

    Hi all,

    Being a mySQL virgin this is my first post and I apologise if it is a bit basic and has been answered many times before. I have searched this and other forums and cannot find an answer and am about to kill my computer, my pets and then myself

    I have a Windows 2000 setup (sorry!) and mySQL v2.32.52-nt and have been working with it for about a week now and have been getting on just fine.

    However.......................

    I started playing with using sql files to create databases and tables and insert data and everything was working fine and then all of a sudden things stopped working completely. SQL that had worked without a hitch started chucking up errors and I simply couldn't use files anymore????????

    Now when I try to use a file to create db's, tables or insert data i simply get the following error:

    ERROR 1102: Incorrect database name "<the location of the file>"

    I have tried many things like creatibng the db first, using just the table create code and adding the db name in the command line call like so:

    mysql -u root -D <dbname> -p "<the location of the file>"

    And every other permatation of this just to make sure it's not me being an arse

    If anyone can help me I would REALLY appreciate it and you could save my life

    TIA - Jaysun

    .................now where's that cat!!!!!

    P.S. Can anyone point me to some decent beginners web sites, forums etc. etc. apart from this one - Cheers
    Last edited by jaysun; 11-14-2002 at 11:15 AM.

  • #2
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    Well, first lets see if you've got the steps correct.

    You should do something like this:
    Code:
    c:\mysql\bin> mysql
    mysql > show databases;
    # This will show the databases available, test, & mysql are standard.
    # if your db is not there, you will need to create it like so.
    Code:
    mysql > create database myDB;
    #this will create a database named myDB
    #next you will need to tell mySQL to use the DB, like so...
    Code:
    mysql > use myDB;
    #now you can add tables 2 ways, on the command like like so.
    Code:
    mysql > create table myTable(id int auto_increment, field varchar(25), field2 varchar(30));
    or, if you have your sql in an external file you can use...
    Code:
    mysql > source "c:/mydir/subdir/mySQLFile.sql";
    remember to use forward slashes not backslashes.

    Hope this helps.

  • #3
    New to the CF scene
    Join Date
    Nov 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi bcarl314

    thanks for your v.quick reply

    my problem isn't with using the basic mySQL commands within mySQL like use and create etc. etc. it's when i try to use files from the shell/command line and not within mySQL

    i haven't tried

    mysql > source "c:/mydir/subdir/mySQLFile.sql";

    so will give it a go and see what happens

    thanks again for you time and help - cheers - jason

  • #4
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    I'm pretty sure on the source syntax, but you may want to check the "help" from within mysql, it will display the proper syntax.

  • #5
    New to the CF scene
    Join Date
    Nov 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi bcarl314

    thanks for your last post btw but my install must be really flakey as things have gone even weirder now LOL

    i tried using 'source' and the first time it worked fine but when i tried to re-run the same sql it simply deleted it from the file??????

    I think i'm getting a bit closer to the issue but being new to all this might be wrong I have managed to re-create the same problem using mySQL Front v2.5 (http://mysqlfront.venturemedia.de/ - top right for the software) in the following way........

    1. Run mySQL Front & log on with the root user
    2. Go to the query tab & 'Load SQL from text file' - load SQL

    Here's my code.....
    -----------------------------
    create database office;

    use office;

    create table cust_details(
    ID tinyint(5) auto_increment primary key not null,
    FirstName tinytext,
    LastName tinytext,
    AddLine1 tinytext,
    AddLine2 tinytext,
    City tinytext,
    PostCode varchar(10) not null,
    Email varchar(40),
    DayTel varchar(20),
    key PostCode(PostCode)
    );

    create table products(
    PID tinyint(6) auto_increment primary key not null,
    ProductCode varchar(10),
    ProductDesc tinytext,
    Available varchar(10) default 'YES',
    Price decimal(11,2) default '0.00'
    );

    create table orders(
    OID tinyint(6) auto_increment primary key not null,
    Date date not null default 'curdate()',
    CustomerID tinytext,
    Despatch varchar(10) default 'UPS',
    DespatchDate date
    );
    -----------------------------

    3. Excute SQL (F9) - it should work fine!!
    4. Tools > Refresh to see the new database in the left pane.
    5. Now drop the created 'office' database.
    6. Go back to the 'Query' tab and re-run the SQL.

    You should get : Unknown database 'office' error...........

    7. Use Tools > Refresh again.
    8. Re-run the SQL again.

    All should work ok...............

    this seems to point to the fact that when a db is created then dropped and then re-created you need to refresh mySQL. I have tried using:

    shell> mysqladmin -u root -p reload

    but to no effect

    If you have any advice I really appreciate it as I'd simply like to know what's happening

    tia - jaysun

  • #6
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    Do you usually use a GUI, or run from the command line? If you want a GUI, I'd suggest adding phpMyAdmin.

  • #7
    New to the CF scene
    Join Date
    Nov 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi carl314

    i've not really used GUI for mySQL at the moment to be honest as I wanted to be a geek and learn from the command line first so hopefully get a better understanding of what's going on in the back ground

    I've just got a copy of phpMyAdmin so will have a look at it later.

    Thanks for your help - Cheers - jaysun


  •  

    Posting Permissions

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