How do i access mysql from mac terminal, using xampp?

后端 未结 8 2100
忘了有多久
忘了有多久 2020-12-13 15:42

I am trying to access mysql from my mac\'s terminal.

I have tried just typing

mysql -u root -p

(and Enter, but that doe

8条回答
  •  Happy的楠姐
    2020-12-13 16:20

    I usually do this to activate php and mysql from terminal with XAMPP 1.7.3(and probably above) on Mac

     1. Go to Terminal
     2. Enter which php: If it says /usr/bin/php, then proceed to 3.
     3. Enter sudo nano ~/.bash_profile (or sudo vim ~/.bash_profile if you know how to use it)
     4. Then paste this export PATH="/Applications/XAMPP/xamppfiles/bin:$PATH"
     5. Ctrl - O then enter to save, then ctrl - X to exit.
     6. Type cd ~
     7. type . .bash_profile
     8. Restart terminal.
     9. Enter which php: If you did it right, it should be the same as the path in #4.
    

提交回复
热议问题