0

Some one please correct the below syntax to restore the mysql backup file using command prompt.

"C:\MySQL\MySQL Server 5.7\bin\mysql.exe" -u root -pmypassword source C:/Program Files/Default Company Name/Setup2/Dump20160805.sql 
10
  • 2
    how about -e "source /path/to/my/file.sql" Commented Aug 9, 2016 at 4:01
  • @Drew wow.. thanks lot bro Commented Aug 9, 2016 at 4:04
  • 1
    cool. Something I said actually worked once ! Commented Aug 9, 2016 at 4:04
  • @Drew i am new to mysql and cmd bro. can you help me to resolve the this error mysql> Dump20160805 < Dump20160805.sql ; 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 'Dump2 0160805 < Dump20160805.sql' at line 1 Commented Aug 9, 2016 at 4:32
  • if you want to run mysqldump do it from the os command line, not inside mysql cmd line. So from within mysql cmd line type quit. Then follow a tutorial about mysqldump Commented Aug 9, 2016 at 4:34

1 Answer 1

1

"C:\MySQL\MySQL Server 5.7\bin\mysqldump.exe" -uroot -pmypassword > C:/Program Files/Default Company Name/Setup2/Dump20160805.sql

Sign up to request clarification or add additional context in comments.

4 Comments

@lzzat raxmatov i want to restore the database
"C:\MySQL\MySQL Server 5.7\bin\mysql.exe" -uroot database_name -pmypassword < C:/Program Files/Default Company Name/Setup2/Dump20160805.sql
@Lzzat thansk it worked. is it possible to print the out from mysql.exe to cmd?
Yeap you need on windows configure environment path to mysql

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.