Unable to create function or procedure in MYSQL

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Unable to create function or procedure in MYSQL

Postby a.sattout » 27. July 2020 10:14

I'm trying to create a function in the MySQL PhpMyAdmin interface.

Whenever I try to create it, even a very simple one such as

Code: Select all
BEGIN

return 2;

END


it keeps returning the same error :

One or more errors have occurred while processing your request:
The following query has failed: "CREATE FUNCTION `abc`() RETURNS INT NOT DETERMINISTIC NO SQL SQL SECURITY DEFINER return 2"

MySQL said: #1558 - Column count of mysql.proc is wrong. Expected 21, found 20. Created with MariaDB 100108, now running 100411. Please use mysql_upgrade to fix this error


As I understand, I can't upgrade mysql because this is MariaDB, not mysql.

What should I do to fix this error?
a.sattout
 
Posts: 2
Joined: 27. July 2020 10:10
XAMPP version: 7.4.5
Operating System: Mac OS

Re: Unable to create function or procedure in MYSQL

Postby Nobbie » 27. July 2020 11:37

a.sattout wrote:As I understand, I can't upgrade mysql because this is MariaDB, not mysql.


No, you got it totally wrong. You are not requested to "upgrade" your MariaDB, you are requested to execute the tool "mysql_upgrade". That DOES NOT necessarily mean doing an upgrade, "mysql_upgrade" is a tool for fixing release problems of all kinds. And yes, even if you are running MariaDB, there IS a tool called "mysql_upgrade", as MariaDB is a binary replacement for MySQL. All tools are called "mysql...." in MariaDB ("mysql" is the command line SQL interpreter, "mysqld" is the server etc.). Look for mysql_upgrade and run it, as requested.
Nobbie
 
Posts: 11776
Joined: 09. March 2008 13:04

Re: Unable to create function or procedure in MYSQL

Postby a.sattout » 27. July 2020 11:56

Any idea how to run it? I found the file called `mysql_upgrade`, but even when CDing there, and running `./mysql_upgrade` says `cannot execute binary file` on the Mac
a.sattout
 
Posts: 2
Joined: 27. July 2020 10:10
XAMPP version: 7.4.5
Operating System: Mac OS

Re: Unable to create function or procedure in MYSQL

Postby Nobbie » 27. July 2020 19:13

I have no idea what is going wrong, unfortunately i do not have Apple hardware here. Maybe you should ask in an Apple forum about this error message.

P.S.: I think, you are running Xampp as Virtual Machine in a linux environment, but try to run mysql_upgrade in MacOS environment. That cannot work. As I do not recommend the Xampp VM version, you should deinstall it and instead download and run the native MacOS version of Xampp. Unfortunately Bitnami does not sign the different versions any longer, but you can see it in the file size. The VM versions are approx. twice as big as the native MacOS versions. Keep a look on the filesize and download the files you need.
Nobbie
 
Posts: 11776
Joined: 09. March 2008 13:04


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 6 guests