Webtest4444 Posted June 22, 2007 Share Posted June 22, 2007 Greeting, I hope I posted this in the right sub forum As many other I gained a insterest in Php+Mysql but however I have had alot of trouble. For the first I got Xp home edition so In order to be able to run php and mysql on my computer Im useing the Tool Sokkit 3.5. Right basicly I wish to add info do a database by writing mydb.dump file and "merge it" with database. What I have done is to start cmd then write C:\Sokkit\mysql\bin\mysqladmin -u root create mydb Witch goes well and the database has been created. My next step is to make a text file named mydb.dump containing this info; " CREATE TABLE employees ( id tinyint(4) DEFAULT '0' NOT NULL AUTO_INCREMENT, first varchar(20), last varchar(20), address varchar(255), position varchar(50), PRIMARY KEY (id), UNIQUE id (id));INSERT INTO employees VALUES (1,'Bob','Smith','128 Here St, Cityname','Marketing Manager'); INSERT INTO employees VALUES (2,'John','Roberts','45 There St , Townville','Telephonist'); INSERT INTO employees VALUES (3,'Brad','Johnson','1/34 Nowhere Blvd, Snowston','Doorman'); " The file is saved in mysql/bin folder named mydb.dump My next step is to enter cmd again and execute this command; C:\Sokkit\mysql\bin\mysql -u root mydb < mydb.dump But apperently nothing happend, I recive the error message File not found :/ Any help will be accepted humbly Quote Link to comment https://forums.phpfreaks.com/topic/56745-solved-insert-info-with-cmddos-command-line/ Share on other sites More sharing options...
bubblegum.anarchy Posted June 22, 2007 Share Posted June 22, 2007 Try the fully qualified path: C:\Sokkit\mysql\bin\mysql -u root mydb < C:\Sokkit\mysql\bin\mydb.dump Quote Link to comment https://forums.phpfreaks.com/topic/56745-solved-insert-info-with-cmddos-command-line/#findComment-280534 Share on other sites More sharing options...
Webtest4444 Posted June 23, 2007 Author Share Posted June 23, 2007 Thanks for the reply bubblegum. Tryed your suggestion but it didnt work. Still getting the same error message, should i replace the < symbol with somthing else? Quote Link to comment https://forums.phpfreaks.com/topic/56745-solved-insert-info-with-cmddos-command-line/#findComment-280761 Share on other sites More sharing options...
bubblegum.anarchy Posted June 23, 2007 Share Posted June 23, 2007 Syntax looks right, only other thing I can think of without looking at documentation is add -p for password. C:\Sokkit\mysql\bin\mysql -u root -p mydb < C:\Sokkit\mysql\bin\mydb.dump Quote Link to comment https://forums.phpfreaks.com/topic/56745-solved-insert-info-with-cmddos-command-line/#findComment-280795 Share on other sites More sharing options...
Webtest4444 Posted June 23, 2007 Author Share Posted June 23, 2007 Currently my logon is default witch means the user name= root and with no password Could it be that Imade the mydb.dump file wrong?, should the file still looklike a notpad icon or should it be somthing else? Quote Link to comment https://forums.phpfreaks.com/topic/56745-solved-insert-info-with-cmddos-command-line/#findComment-280813 Share on other sites More sharing options...
Wildbug Posted June 23, 2007 Share Posted June 23, 2007 Try "dir c:\sokkit\mysql\bin\" from the command line and post output here. Quote Link to comment https://forums.phpfreaks.com/topic/56745-solved-insert-info-with-cmddos-command-line/#findComment-280838 Share on other sites More sharing options...
Webtest4444 Posted June 23, 2007 Author Share Posted June 23, 2007 Thanks for the reply Did as you asked and upload the result as a picture. Ah and another thing is that I deleted mydb.dump file and made a new one named mydp.dump just to test if it was somthing about the name [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/56745-solved-insert-info-with-cmddos-command-line/#findComment-280991 Share on other sites More sharing options...
Wildbug Posted June 23, 2007 Share Posted June 23, 2007 Do this. C:\Sokkit\mysql\bin\mysql -u root mydb < C:\Sokkit\mysql\bin\mydb.dump.txt Quote Link to comment https://forums.phpfreaks.com/topic/56745-solved-insert-info-with-cmddos-command-line/#findComment-281035 Share on other sites More sharing options...
Webtest4444 Posted June 23, 2007 Author Share Posted June 23, 2007 Meh I should have been able to figure out that myself > <, mydb.dump.txt , addig the txt part worked and the database now have the info. many times thanks for the help Bubble and Wildbug Quote Link to comment https://forums.phpfreaks.com/topic/56745-solved-insert-info-with-cmddos-command-line/#findComment-281063 Share on other sites More sharing options...
Wildbug Posted June 24, 2007 Share Posted June 24, 2007 It was the comment you made about the notepad icon that made me wonder if the file had a hidden .txt extention. Windows by default hides file extentions of known file types because ".txt" is far too technical for common users and will drive them insane and eventually they will buy a Macintosh. Quote Link to comment https://forums.phpfreaks.com/topic/56745-solved-insert-info-with-cmddos-command-line/#findComment-281288 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.