I am trying to run the following script.

Code:
CREATE PROCEDURE sp_select_changelog() 
BEGIN 
SELECT * FROM sys_changelog_data; 
END
But ended getting the following error message.

#1558 - Column count of mysql.proc is wrong. Expected 20, found 16. Created with MySQL 50090, now running 50145. Please use mysql_upgrade to fix this error
I tried mysql_upgrade but getting the following error.

#mysql_upgrade
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/tmp/mysql.sock'
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file
FATAL ERROR: Upgrade failed
Please help me, I tried a lot of solutions which I can found but no one is helping.