943,565 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Marked Solved
  • Views: 2318
  • MySQL RSS
You are currently viewing page 1 of this multi-page discussion thread
Mar 8th, 2008
0

Help building database

Expand Post »
I am relatively new to mysql. I am updating a site for a customer, and I'm using mysql 5 w/ phpMyAdmin. I was supplied an .sql (echeck.sql) script to build the database for this site. I create a database named "echeck" in phpMyAdmin, and once created go to the import tab of phpMyAdmin to import the .sql script...when i click the "go" button i recieve this:

Error

SQL query:

--
-- Dumping data for table `tbl_tax`
--
INSERT INTO `tbl_tax` ( `taxid` , `taxdesc1` , `taxper1` , `taxst1` , `taxdesc2` , `taxper2` , `taxst2` , `taxdesc3` , `taxper3` , `taxst3` , `taxdesc4` , `taxamt1` , `taxst4` , `taxdesc5` , `taxamt2` , `taxst5` , `tax_prt_id` )
VALUES ( 1, 'tax1', 0.00, '1', '', 0.00, '', 'tax2', 0.00, '', 'tax4', 0.00, '1', '', 0.00, '', 26 ) , ( 2, 'taxa', 2.00, '1', 'taxb', 2.00, '1', 'taxc', 2.00, '1', 'taxd', 23.00, '1', 'taxE', 2.00, '1', 52 ) ;

MySQL said: Documentation
#1265 - Data truncated for column 'taxst2' at row 1


The script apparently kicks out and not all the tables are created. Does anyone know the cause of this? should i not be using import to run the script? if so how do i run it then?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mexaros is offline Offline
18 posts
since Jan 2008
Mar 8th, 2008
0

Re: Help building database

It looks like a bug. Here is a bug report.

What is your MySQL version?

You can also use command line utility.
Last edited by mwasif; Mar 8th, 2008 at 2:56 pm.
Reputation Points: 29
Solved Threads: 47
Posting Whiz
mwasif is offline Offline
312 posts
since Dec 2007
Mar 8th, 2008
0

Re: Help building database

I am running version 5
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mexaros is offline Offline
18 posts
since Jan 2008
Mar 8th, 2008
0

Re: Help building database

from what i read, it looks like this .sql file that i have is the dump file created from mysql dump? is this correct? If so, how do I now restore the database using this file? ie: from command line, what would the command be?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mexaros is offline Offline
18 posts
since Jan 2008
Mar 8th, 2008
0

Re: Help building database

The command will be
MySQL Syntax (Toggle Plain Text)
  1. mysql databasename < echeck.sql -uMYSQL-USERNAME -p
Reputation Points: 29
Solved Threads: 47
Posting Whiz
mwasif is offline Offline
312 posts
since Dec 2007
Mar 8th, 2008
0

Re: Help building database

ok, so here is what i type:
mysql echeck < c:/Program Files/Apache Software Foundation/Apache2.2/htdocs/admin/echeck.sql -uMYSQL-ROOT -p

where "root" is a valid user in my mysql. I recieve the error:
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 'mysql echeck < c:/Program Files/Apache Software Foundation/Apache2.2/htdocs/admin' at line 1
What am i doing wrong?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mexaros is offline Offline
18 posts
since Jan 2008
Mar 9th, 2008
1

Re: Help building database

Click to Expand / Collapse  Quote originally posted by mexaros ...
ok, so here is what i type:
mysql echeck < c:/Program Files/Apache Software Foundation/Apache2.2/htdocs/admin/echeck.sql -uMYSQL-ROOT -p

where "root" is a valid user in my mysql. I recieve the error:
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 'mysql echeck < c:/Program Files/Apache Software Foundation/Apache2.2/htdocs/admin' at line 1
What am i doing wrong?
You said 'root' is a valid user, but you use 'MYSQL-ROOT' in the command. Is this what you intended?
Reputation Points: 18
Solved Threads: 20
Junior Poster
trudge is offline Offline
176 posts
since Sep 2007
Mar 9th, 2008
1

Re: Help building database

Kindly replace MYSQL-USERNAME with root.
Reputation Points: 29
Solved Threads: 47
Posting Whiz
mwasif is offline Offline
312 posts
since Dec 2007
Mar 9th, 2008
0

Re: Help building database

ok so i got the syntax correct and it started to run the .sql but i am still getting this error:
ERROR 1265 (01000) at line 894 in file: 'c:\echeck.sql' : Data truncated for column 'taxst2' at row 1

In the echeck.sql, under the create table directive, taxst2 is defined as:
`taxst2` enum('0','1') NOT NULL default '0',

and line 894 in the file is as follows
INSERT INTO `tbl_tax` (`taxid`, `taxdesc1`, `taxper1`, `taxst1`, `taxdesc2`, `taxper2`, `taxst2`, `taxdesc3`, `taxper3`, `taxst3`, `taxdesc4`, `taxamt1`, `taxst4`, `taxdesc5`, `taxamt2`, `taxst5`, `tax_prt_id`) VALUES
(1, 'tax1', 0.00, '1', '', 0.00, '', 'tax2', 0.00, '', 'tax4', 0.00, '1', '', 0.00, '', 26),
(2, 'taxa', 2.00, '1', 'taxb', 2.00, '1', 'taxc', 2.00, '1', 'taxd', 23.00, '1', 'taxE', 2.00, '1', 52);


Where is the problem? How do I correct it?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mexaros is offline Offline
18 posts
since Jan 2008
Mar 9th, 2008
0

Re: Help building database

It seems to be a MySQL bug like this http://bugs.mysql.com/bug.php?id=9029.

Do you have latest MySQL version?

Also try source command.
Reputation Points: 29
Solved Threads: 47
Posting Whiz
mwasif is offline Offline
312 posts
since Dec 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: retrieve data frm 2 tables
Next Thread in MySQL Forum Timeline: Incorrect string value





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC