Jump to content

accessing mysql through terminal

- - - - -

  • Please log in to reply
1 reply to this topic

#1
dk1081

dk1081

    Newbie

  • Members
  • Pip
  • 3 posts
Hello. I am very new to this so I had some questions if you guys would be so kind...

[Running XAMMP on a MAC]
I'm trying to connect to the MySQL server that Apache is hosting through the command prompt, but my commands are not going through.

I am current at the "Terminals" application under applications/utilities and I am typing in to the prompt "mysql -h localhost -u root -p". The prompt returns the following "-bash: -mysql: command not found"

What am I doing wrong here? Thanks in advance.

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
  • Location:Vancouver, Eh! Cleverness: 200
You will need to access the binary executable directly, as it is in a path your system does not recognize.

If your XAMPP installation were in /opt/xampp (which it may or may not be), you would access the mysql executable like so:
/opt/xampp/bin/mysql -u root -p

Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users