Macbook M1 MacOS Big Sur Error MySQL PhpMyAdmin When Login

I login to MySQL using phpMyAdmin with root account and it produced this error.

Login root via terminal

I was able to login using my root password means something configuration is not correct.

macbook M1 mysql login via terminal
macbook M1 mysql login via terminal

When I googled, I found 2 solutions. I tried the first one but fail. So I documented the one that works with Macbook M1 MacOS Big Sur.

Update root Password via Terminal

Login Again At Your phpMyAdmin

It should work by now using root and the updated password.

php.ini File Location at MacOS Catalina

Disable PHP Warning Message

I wanted to disable my warning message from my php installation. To do so

I need to configure my php.ini file. I searched on the internet but couldn’t find a direct answers where to change my php.ini on MacOS Catalina.

php warning appears
php warning appears

Location of php.ini File at MacOS Catalina

For MacOS Catalina the location of php.ini is located at /etc/

You can verify it by printing phpinfo() and look for “Loaded Configuration File (php.ini) path”

phpinfo location of php.ini
phpinfo location of php.ini

For my MacOS Catalina, the location of php.ini is located at /etc/. As you can see there is no php.ini is loaded (None).

Load Your Own php.ini File

To load your own php.ini, copy the default file into your new php.ini

Open the php.ini, in this case I’m using atom to open it.

Then change php error reporting into

Save it then restart apache.

Then check the php.ini file is loaded correctly by printing the phpinfo. It will shows /etc/php.ini at “Loaded Configuration File” row.

phpinfo loaded php ini at macos catalina
phpinfo loaded php ini at macos catalina

or you can run php –ini to see the loaded configuration file.

macos php ini command
macos php ini command

When you refresh the website, the warning php message will disappear.

php warning message disappear
php warning message disappear

Notes

You can use same technique for MacOS Big Sur on MacBook Pro M1.