I've got a vanilla install of XAMPP in OS X. How can I access the mysql command line tool? I've tried typing "mysql" at the command line, and it spits back "-bash: mysql: command not found".
To access SQL via the command line we simply navigate to the xampp folder. the folder is usually on the c:\ drive. type: cd c:\xampp\mysql\bin then press enter. type: in mysql -u root -p then press enter.
Go to your XAMPP folder, wherever you set it up during installation (Applications is the default), and then to the xamppfiles folder, and then phpmyadmin. Once you open up phpmyadmin, find the file config. inc.
XAMPP is installed in Mac OS X in the following directory:
/Applications/XAMPP/
You can look what's inside that directory and run mysql command line tool providing the full path to it:
$ /Applications/XAMPP/xamppfiles/bin/mysql
If you need, you can modify your PATH environment variable to include XAMPP binaries and you won't need to specify the whole path all the time.
Open your .profile file in Mac. This can be done by entering the terminal and typing
pico ~/.profile
Add the following line to your ./profile file. Replace the path where you installed Xampp, however by default this is the route and should work:
export PATH=/opt/local/bin:/opt/local/sbin:/Applications/xampp/xamppfiles/bin:$PATH
Open a new terminal window (Recommendation is to quit all terminal windows and then reopen) and type:
mysql
That is all, isn't easy!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With