In this article I will explain with an example, how to resolve the following error: Fatal error encountered during command execution while working with MySQL database.
 
 

Error

This error occurs due to the following reason in MySQL database.
1. MySQL query is being executed with wrong column name which is not present in Table.
MySqlException: Fatal error encountered during command execution error in MySql Database
 
In the below MySQL query, the column name is specified as Id which is not present in Table.
SELECT Id, Name, Country FROM Customers;
 
 

Solution

Following is the solution for the above error.
1. Make sure that the table name is correct.
SELECT CustomerId, Name, Country FROM Customers;