0

Hello
Could help me get the right MySQL on my computer. I had it installed but it was a couple
years ago. My cp crashed. I can't remeber how or what to install. All I have left
is the script I used. I was running the command window one. that is fine if I new which
one to install.
thanks.

2
Contributors
9
Replies
10
Views
6 Years
Discussion Span
Last Post by smantscheff
0

http://dev.mysql.com/doc/refman/5.1/en/windows-installation.html

I re-installed the:mysql-essential-5.1.52-win32.msi
Thanks
Is there a indication here how to find which insert went bad? there are about 1000
to choose from.

ERROR 1064 (42000): 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 'INSER
T INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) V' at
line 2
0

If you restore your database from a dump file the error message should tell the correct line number of this file.
Most common problems when inserting from a dump are non-escaped quotes in field content. Search for a regular expression like "'[^',]+'[^,]" (not tested) which might find unescaped quotes in your input.

0

If you restore your database from a dump file the error message should tell the correct line number of this file.
Most common problems when inserting from a dump are non-escaped quotes in field content. Search for a regular expression like "'[^',]+'[^,]" (not tested) which might find unescaped quotes in your input.

I don't know MySQL that well. I just ran my script.

Search for a regular expression

I don't understand where to search:
and "'[^',]+'[^,]" is ^ to escape ' <-really dumb question.
I am not sure how to search .

0

Well, then show us your script. The error will be in there.
And no, the circumflex ^ means "not" in regular expressions. So my expression intends to search for a (single) quote, followed by anything which is neither a quote nor a comma, followed by a quote, followed by something not a comma.

Edited by smantscheff: n/a

0

ok cool. now is that just something used in the command line?
never done a search.

Edited by ceyesuma: can't spell

Attachments
DROP DATABASE IF EXISTS splashbookdb;
CREATE DATABASE splashbookdb;
USE splashbookdb;

CREATE TABLE branch
( Branch_Number 	INT(4) Primary Key,
Branch_Name 		char(20),
Branch_Location         char(20),
Number_Employees	INT(4) );

INSERT INTO branch VALUES (1,'home','south_side!',1);


CREATE TABLE publisher
( Publisher_Code	char(2) Primary Key,
Publisher_Name		char(20),
Publisher_City		char(20),
Publisher_State         char(2),
Publisher_web           char(20) );

INSERT INTO publisher VALUES ('HL','Hal Leonard corp.','Milwaukee','Wi','www.halleonard.com');

CREATE TABLE author
(Author_Number		INT(4) Primary key,
Author_Name		char(20),
Author_First		char(20),
Author_Publisher        char(20) );

INSERT INTO author VALUES (1,'Archer','Jeffrey','Hal Leonard corp');


CREATE TABLE book 
(book_isbn		char(20) Primary Key,
book_title		char(100),
publisher_code          char(2),
book_type		char(35),
transposed              char(8),
grandstaff              char(3),
lead                    char(3),
num_pages               INT(4),
book_price		decimal(4,2),
paperback		char(1) );

INSERT INTO book VALUES ('0-634-05315-9','Guitar Tab White Pages Vol 2','HL','ROCK','guitar','yes','no',1024,29.95,'Y');


CREATE TABLE wrote(
book_isbn		char(20) PRIMARY KEY,
author_number           INT(4),
sequence_number         INT(4)
);

INSERT INTO wrote VALUES ('0-634-05315-9',1,1);


CREATE TABLE invent(
book_isbn		char(20) PRIMARY KEY,
branch_number           INT(4),
Units_on_hand           INT(4),
Price                   decimal(2,0)
);

INSERT INTO invent VALUES ('0-634-05315-9',1,1,24.95);

CREATE TABLE content(
id INT(5) NOT NULL AUTO_INCREMENT PRIMARY KEY,
publisher_code          CHAR(2),
book_isbn		char(20),
book_title              char(100), 
artist                  char(150),
song                    char(150),
page_num                INT(4)
);

INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Bryan adams','Its Only Love',371);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Aerosmith','Same Old Song & Dance',622);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Alice in Chains','No Excuses',513);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Asia','Heat of the Moment',268);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Chet Atkins','Galloping on the Guitar',232);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Bachman-Turner Overdrive','You Aintt Seen NothinYet',979);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','The Beach Boys','Fun,Fun,Fun',226);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','The Beach Boys','Help Me Rhonda',280);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','The Beatles','Blackbird',58);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','The Beatles','Here Comes the Sun',285);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','The Beatles','I Feel Fine',316);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','The Beatles','Yesterday',975);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Beck','Where its At',922);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Jeff Beck','Freeway Jam',211);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','The Bee Gees','Stayin Alive',747);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','George Benson','The Promised Land',548);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Black Sabbath','WarPigs (Interpolating Lukes Wall)',880);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Blink-182','Dammit',132);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Bon Jovi','In and Out of Love',343);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Booker T & The MGs','Green Onions',237);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','david bowie','Suffragette City',760);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','The Brian Setzer Orchestra','Jump, jive an Wail',381);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Brooks& Dunn', 'Boot Scootin Boogie',71);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','James Brown','I got you (I Feel Good)',319);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','The Calling','Wherever You Will Go',925);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Carter Family','Wildwood Flower',945);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','The Champs','Tequila',801);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Tracy Chapman','Fast car',195);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Cheap Trick','I Want You to Want Me',331);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Eric Clapton','I Shot the Sheriff',322);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Eic Clapton','Layla(Acoustic)',418);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Eric Clapton','Wonderful Tonight',945);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Coal Chamber','Loco',435); 
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','ColdPlay','Yellow',969);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Cream','White Room',934);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Crosby,Stills & Nash','Our House',531);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Deep Purple','Woman From Tokyo',948);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Default','Wasting my Time',889);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Dire Straits','Money for Nothing',479);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Eagles','Best of my Love',50);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Duane Eddy','Rebel Rouser',566);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Edgar Winter Group','Frankenstein',204);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Electric Light Orchestra','Sweet Talkin Woman',771);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Everclear','Santa Monica',629);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Extreme','More Than Words',495);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-05315-9','Guitar Tab White Pages Vol 2','Fabulous Thunderbirds','Tuff Enough',849);
INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL
0

Go learn about regular expressions and the program grep. There are a lot of editors which can search for regular expressions, too. I recommend EditPad++
But this was not the error, though.
Look at

INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-01176-6','The Greatest Rock Guitar Fake Book','The Who','My Generation',277)

The semicolon is missing at the end.

0

Go learn about regular expressions and the program grep. There are a lot of editors which can search for regular expressions, too. I recommend EditPad++
But this was not the error, though.
Look at

INSERT INTO content (publisher_code,book_isbn,book_title,artist,song,page_num) VALUES ('HL','0-634-01176-6','The Greatest Rock Guitar Fake Book','The Who','My Generation',277)

The semicolon is missing at the end.

Great thanks I'll look that up.

Before I leave the install post:
I started learning db's using Microsoft exess. Is the MySQL the same?
I was able to build the tables and relationships,forms and all that using a GUI with exess.
Is there a particular dl that has tools as such?

0

MySQL is similar with Access in being a relational database. If you use InnoDB as storage engine you can have foreign key constraints to guard the relational integrity. It has stored procedures, triggers and views - I don't know if Access has those.
A nice GUI for MySQL is Navicat. A browser-based alternative is phpMyAdmin (somewhat clumsy to use, though).
I recommend learning the command line interface, though. It is by far the fastest way to get things done.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.