Import SQL File into MySQL in XAMPP from Command Line in MacOS

To import SQL file in XAMPP MySQL, first has to go to XAMPP MySQL bin then do the command standard Mysql import command line.

XAMPP Path in MacOS

Command in Terminal

Example:

XAMPP mysql import sql file

 

Access XAMPP 8.2.4 MySQL via Command Line in MacOS

You can access XAMPP 8.2.4 MySQL via command line in MacOS by following these steps.

1. Go to XAMPP 8.2.4 MySQL folder in MacOS

2. Type This Command

If successful, XAMPP will connect to MariabDB instead of MySQL

You can double check by getting all databases in the MariaDB.

 

macos xampp 8.2.4 mysql access via command line
macos xampp 8.2.4 mysql access via command line

How To Launch XAMPP After Installation?

I installed XAMPP then after installation the XAMPP control manager appeared after that. If you restart your computer, I wonder where I can launch it because XAMPP is not appeared in LaunchPad.

Applications folder of XAMPP also has so many files.

How To Launch XAMPP?

Go to Applications -> XAMPP -> xamppfiles .

Then click on manager-osx.

Key in your password and then the XAMPP control manager will appear.

manager-osx to open xampp
manager-osx to open xampp

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.