I am trying to restore my MYSQL 5.7 database from .sql dump file with the following command:
mysql -h hostname -u username -p databasename < backup.sql
But, I am getting the following error:
ROR 1305 (42000) at line 5940: FUNCTION dbtable.getaccountname does not exist
The line 5940 of .sql file contains the following:
/*!50001 VIEW
vloantransaction
AS selectloantransaction
.transactionid
AStransactionid
,loantransaction
.bookingdatenp
ASbookingdatenp
,loantransaction
.accountnumber
ASaccountnumber
, getaccountname(loantransaction
.accountnumber
,'a') ASaccname
,getaccountname (loantransaction
.accountnumber
,'h')
As mentioned in the comment above, mysqldump --routines
is required to include stored procedures, functions, and events in the dump output. This option is not enabled by default, so you have to remember to use it when you dump your database.