I am using MySql 5.1. I want to create a dump file through command prompt. I am using the MySQL Command Line Client. I have searched on web and got a command as.

mysql -u username -p password -h host database_name > dumpfile.sql

While executing it in my client command prompt as

mysql> mysql -u root -h localhost MyDatabase > DBdumpfile.sql;

But it is showing following error

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 -u root -h localhost MyDatabase > DBdumpfile.sql' at line' 1

Here password is not given as there is no password set.

Thanks and Regard,
Victoryy...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.