Databases :: MySql :: Importing a *.sql (unix mysql database) file to the windows environment. |
|||
| By: silviobarilla |
Date: 28/04/2003 00:00:00 |
Points: 300 | Status: Answered Quality : Excellent |
|
Im trying to convert a mysql database on a unix machine to a windows environment. I have created the *.sql file on the unix machine with: mysqldump -uuser -ppassword dbasename > filename.sql I then ftp'd this file to the new windows machine. Here I use the following command to import the *.sql file into the windows environment: mysql -uuser -ppassword dbasename < filename.sql I then get the following error: ERROR 1064 at line 19243649: 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 'Database varchar(50) default NULL, Datatype varchar(50) defau What am I doing wrong? |
|||
| By: carchitect | Date: 28/04/2003 18:41:00 | Type : Comment |
|
| pls check the mysql versions on both the platforms are they compatible could you pls post the mysql file so that i can try it on my pcregards |
|||
| By: VGR | Date: 28/04/2003 21:29:00 | Type : Answer |
|
| DATABASE IS A RESERVED KEYWORD !!!! |
|||
| By: silviobarilla | Date: 28/04/2003 21:31:00 | Type : Comment |
|
| Carchitect, the file is 6.0Gig. |
|||
| By: silviobarilla | Date: 28/04/2003 21:33:00 | Type : Comment |
|
| VGR, I guess my next option is to see if any fields use that name. Thanks! I'll keep you posted. |
|||
| By: VGR | Date: 28/04/2003 21:55:00 | Type : Comment |
|
| there IS ! Look at "You have an error in your SQL syntax. [...] near 'Database varchar(50) default NULL," that's clearly a table definition in a CREATE TABLE phrase |
|||
| By: silviobarilla | Date: 29/04/2003 09:58:00 | Type : Comment |
|
| VGR, I have found the field with the reserved name of 'database' Thanks a million for your quick response. |
|||
| By: VGR | Date: 29/04/2003 15:43:00 | Type : Comment |
|
| you're welcome :D there are two types that are not reserved keywords but that should be. This means you can use them but may occasionally encounter problems because of this those are DATE and TIME ie you can declare CREATE TABLE toto (id integer, date date); IMHO, "generic" names like table, database, date, time, timestamp, datetime, index etc should be avoided in user-provided names as possible |
|||
| By: silviobarilla | Date: 08/05/2003 05:05:00 | Type : Comment |
|
| Hi VGR, I cant seem to alter the fields which have the reserved key words. (ie: match) Do you know the correct syntax I should be using? |
|||
| By: VGR | Date: 08/05/2003 05:25:00 | Type : Comment |
|
| show me the actual layout (describe tablename;) and the SQL query you tried, please |
|||
| By: silviobarilla | Date: 26/06/2003 11:42:00 | Type : Comment |
|
| Hi VGR, Sorry for not getting back to you on the last question but I managed. Could you please tell me how to create an additional user. Im currently using 'root' and no 'password' the default. thanks again! silvio |
|||
| By: VGR | Date: 26/06/2003 15:19:00 | Type : Comment |
|
| <A HREF="http://www.mysql.com/doc/en/Adding_users.html">http://www.mysql.com/doc/en/Adding_users.html</a> mysql --user=root --password=yourpassword use mysql a) GRANT ALL PRIVILEGES ON *.* TO monty@host IDENTIFIED BY 'some_pass' WITH GRANT OPTION; or b) GRANT ALL PRIVILEGES ON *.* TO monty@"%" IDENTIFIED BY 'some_pass' WITH GRANT OPTION; or c) INSERT INTO user VALUES('localhost','monty',PASSWORD('some_pass'),'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'); and FLUSH PRIVILEGES; quit; (done) |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








