Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mariaalf

macrumors newbie
Original poster
Nov 23, 2008
1
0
I have installed MySQL .0.67 in my Mac Book Pro OS X 1.5 and followed the MySQL site instructions for *.dmg.However I must have missed something because after starting the server thru the System Preferences Mysql pane (it says "MySQL ...is running" but when I open a Terminal session, I have always that message for every command:
-bash: mysql: command not found (even when I am inside the bin directory)
and in a php test aplication I got the following message:
mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO)
I am a new MAC user so may be it is something too obvious but I am trying and trying and nothing happens .
Can anyone help me pleeeeease?
Thanks Maria
 
I believe you mean MySQL version 5.0.67 (not .0.67) and Macbook OSX 10.5 (not 1.5).

To use MySQL from the command line you'll need to add it to the path environment. To do so, open Terminal and edit your .profile file (or .bash_rc) and add a line like,
Code:
export PATH=/usr/local/mysql:/usr/local/mysql/bin:$PATH
then save it and close Terminal and open it back up. You should now be able to use the mysql command from the command line. Be sure you have the right location above though. You can check where MySQL is installed from the Terminal by typing in,
Code:
which mysql
and that will give you the path to MySQL, so you can make sure you're accessing the correct bin folder.

Frankly though, installing MySQL on its own is more complicated than it should be and is unnecessary. I recommend you install MAMP, which will give you a local web development setup (Apache, PHP, MySQL, etc.). With MAMP installed you still need to edit your path variable to play with it from the command line. You'll edit your .profile like so,
Code:
export PATH=/Applications/MAMP/bin/php5/bin:/Applications/MAMP/Library/bin:$PATH
in order to use it. The default password is either root or blank (as in ""). I can't remember anymore.

However, if you do want to install MySQL as you're doing, I recommend Apple's documentation on it. You can also install MySQL through MacPorts.
 
Try using a program called MAMP its free and it instals PHP & Mysql !
You can buy the program and have a couple of more functions.
Or you could use the free 1 that I use and it works fine..
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.