Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

1/09/2012

ลง mysql ด้วย homebrew

วันนี้ลง mysql ด้วย homebrew ซึ่งเป็น package manager ใน mac os x

วิธีลง ดูได้จาก https://github.com/mxcl/homebrew/wiki/installation

เอาล่ะหลังจากลงแล้วก็เริ่มเลย 

  1. หา mysql package โดยใช้

    $ brew search mysql
  2. หลังจากหาเจอแล้วจะเห็นชื่อ package ที่มันหาได้ ต่อมาให้ใช้

    $ brew install mysql
  3. ขั้นตอนนี้ต้องรออีกสักแปป เพราะมันไปโหลด dependency และ ตัว mysql เองมาและต่อด้วย compile (ขั้นตอน compile นี่แหละนาน) 
  4. หลังจากนั่งเล่น facebook จนมัน compile เสร็จแล้วทีนี้ เราจะมาทำการ start mysql service โดยสั่ง

    $ sudo mysqld --user=root &
  5. หลังจากนั้นก็จะสามารถใช้ mysql shell ได้

    $ sudo mysql -u root -p
  6. ขอให้สนุกกับ mysql :)

10/01/2011

Uninstall MySQL

เขียนแปะไว้ก่อน ฮาๆๆ

To uninstall MySQL and completely remove it (including all databases) from your Mac do the following:

Use mysqldump to backup your databases to text files!
Stop the database server
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
edit /etc/hostconfig and remove the line MYSQLCOM=-YES-

rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
sudo rm -rf /private/var/db/receipts/*mysql*

The last three lines are particularly important as otherwise, you can't install an older version of MySQL even though you think that you've completely deleted the newer version!