Wednesday, June 13, 2012

How to install MySQL server on Mac OSX 10.x or Lion with using terminal


:: How to download MySQL community server on Mac OSX 10.7 or Lion
:: How to install MySQL command in terminal on Mac OSX 10.7or Lion

1. MySQL Community Server
2. Then install the *.dmg file with two of *.pkg and one *.prefpanel
3. How to make your terminal work with mysql command :
     ::follow these instructions::

Bash will complain that it can’t find mysql. So we have to help it like so:

1. Create a file .bash_profile with your own editor with content below
* make sure you check that it has existed directory mysql in /usr/local/ ?
export PATH=$PATH:/usr/local/mysql/bin 
2. Save .bash_profile to /Users/%username% which %username% is your username directory
3. Restart the terminal the make a command :
source ~/.bash_profile

4. Checking your PATH by type :
$PATH

5. There will be showed look like this :
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/mysql/bin

6. Now you should able to run mysql:
mysql -u -root 

*Note : which means you have no password for root.

mysqladmin -u root password



By Jack@COMPUTER-SCIENCE

No comments:

Post a Comment