I want to copy/duplicate a database using C# I tried in the following way but it gave me error saying check mysql syntax.
string connStr = "server=localhost;user=root;port=3306;";
            MySqlConnection conn = new MySqlConnection(connStr);
            MySqlCommand cmd;
            string s0;
            try
            {
                conn.Open();
                s0 = "mysqldump -h localhost -u root -p testdb | mysql -h localhost -u root -p `"+dbname+"`;";
                cmd = new MySqlCommand(s0, conn);
                cmd.ExecuteNonQuery();
                conn.Close();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            } 
No password for MySQL database. Can anyone tell me what's the issue in this code? Thanks.
 
     
     
    