[教學] 如何在10.7 Lion下更改家目錄名稱


[此篇文章為"Mac OS X Lion 哪裏有問題"一書,Part1 Q06 進階修改方法教學]

在台灣向經銷商購買Mac電腦,大部分時候經銷商會幫我們預先裝好一些軟體和設定,因此使用者名稱通常都是"apple"或"mac"之類的,想要更改這個名稱,可以另外一新增一個使用者,填入自己喜愛的名稱,再換用那個帳號即可。
如果真的想要保留經銷商幫您預先安裝的那些軟體和設定,或者電腦已經使用一段時間,要搬移檔案很不方便,又想要改名稱的時候,才建議使用這種方式來修改名稱。
此種方法,Stanley雖然也有試過成功,但是還沒有檢驗會有哪些後遺症,所以也請你小心使用,並且自行負責和承擔後果
請注意,以下這種方法,範例為舊名稱為stanley,新名稱為apple,你可以依樣畫葫蘆來修改你自己的電腦。

首先,也請先進入系統偏好設定>>使用者與群組,解鎖後,進入登入項目,停用自動登入、快速切換,另外,也請注意關閉FileVault(如果你有使用的話)。
再來,再使用者與群組項目中,先輸入使用者密碼解鎖,進入"登入項目",按下"加入",接著再按下"打開目錄工具程式"。
開啟目錄工具程式後,選目錄工具程式的 編輯>>啟用Root使用者
接著會請你為這個root使用者輸入一組密碼。輸入完密碼之後,你就可以登出原本的帳號,然後使用root和剛剛那組密碼來重新登入系統。
使用root帳號登入系統之後,點選Finder選單列中的"前往">>"電腦"。
在硬碟>>使用者 的資料夾中,找到原本的帳號名稱,假設是如下圖所示,原本是stanley,然後對它按下enter,可以直接修改它的名稱,例如把它直接改成我們要的 apple。請注意,新帳號名稱必須要英文小寫,且不能有空白和其他特殊符號。

再來,進入系統偏好設定>>使用者與群組 點選下圖紅框中的+號來新增一組帳號。
跳出來的視窗中,新帳號選擇"管理者",並且名稱的地方,一定要取名為我們要更改的新名稱,這邊的範例,新名稱為apple,密碼也請填起來~
按下建立使用者後,會跳出以下警告視窗,跟我們說已經有人使用這個名稱,點選"使用現有資料夾"。這樣系統就會把舊名稱的使用者資料夾重新指向到新的帳號名稱下。
重新開機後,用新的帳號密碼登入,如果一切沒有問題,就表示修改家目錄名稱成功啦~
最後,記得再回到 步驟1,開啟目錄工具程式,點選編輯裡的"停用Root使用者",就大功告成了。

How to remove MySQL on Mac

ref [1]: http://jimmyphenphen.blogspot.com/2008/06/mac-mysql.html
ref [2]: http://www.j2h.tw/bbs/bbs16/150.html
ref [3]: http://www.comentum.com/mysql-administration.html


若要移除MySQL,請先登入成root,系統最高權限管理者的帳號,將"/usr/local/mysql-版本號碼/data/"檔案夾內,已建立的重要資料庫檔案夾,複製備份出來,再直接將"/usr/local/mysql-版本號碼"這個子目錄直接刪除,
另外在 /資源庫/Receipt/mysql-版本號碼.pkg這個檔案也順便刪除,即完成MySQL在MacOSX平台的軟體移除程序。

Where are the Apache Configuration files on Mac?


Here’s where to find httpd.conf on Mac. This is the httpd.conf location on Mac OS X 10.6 Snow Leopard and Mac OS X 10.7 Lion. This article also shows how to make the httpd.conf directory visible in the Mac Finder.

What is Httpd.conf?

Httpd.conf is the Apache web server’s main configuration file. Mac OSX ships with Apache installed. See Apache’s configuration docs for how to configure Apache.

Httpd.conf Location on Mac

On Mac httpd.conf location is in the directory /etc/apache2. You can access this folder through the Mac Finder or through the Mac Terminal.
Checked on OS X 10.7, 10.6.8, 10.6.7.

Httpd.conf Location in Mac Finder

You won’t normally see even the /etc/apache2 directory showing up in the Mac Finder. I tried looking in Macintosh HD, but /etc doesn’t show up.)
I found a tip at Codejacked on how to open hidden files in the Finder.
Here’s how to view httpd.conf’s directory in the Mac’s finder:
  1. In the Finder, click the Go menu, and choose Go to Folder…
  2. Type in /etc/apache2.
  3. Click Go.
The Finder will show the apache2 folder, and in it, you’ll see httpd.conf.

Httpd.conf Location in Mac Terminal

You can also get to the httpd.conf file through a terminal session, which is okay if your comfortable in the Unix shell (bash):
tazpro:~ taz$ cd /etc/apache2
tazpro:apache2 taz$ ls
extra  magic  original users
httpd.conf mime.types other

Can’t Save Httpd.conf?

Httpd.conf is protected by OSX from being edited. If you open it with the TextEdit application for example, you won’t be able to save it. For details to bypass this security, see How to Easily Edit Httpd.conf on Mac.

Restart Apache to Apply Configuration Changes

Don’t forget you will need to restart Apache for your configuration changes in httpd.conf to be applied. To restart Apache on Mac:
  1. Go to the Apple menu and choose System Preferences.
  2. Click on Sharing.
  3. Untick Web Sharing.
  4. Tick Web Sharing.

Installing MySQL server on Mac OS X Lion

ref [1]: http://www.djangoapp.com/blog/2011/07/24/installation-of-mysql-server-on-mac-os-x-lion/
ref [2]: http://dev.mysql.com/downloads/mysql/
ref [3]: http://downloads.mysql.com/archives.php?p=mysql-5.5&o=%28%3F%3Adarwin%7Cosx%29


Installation of MySQL server on Mac OS X Lion



This article is part of Django Installation on Mac OS X Lion
At the time of writing this post, MySQL Server on MySQL site doesn’t have installer package for OS X 10.7 (aka Lion) but 10.6 Package works just fine for 10.7 as well. This may change soon and we may see package for OS X 10.7 as well or may be rename current package to 10.6 & above.
Installing MySQL community server:
  1. Download the latest  64-Bit DMG Archive (Apple Disk Image) from MySQL Site (http://dev.mysql.com/downloads/mysql/). Current latest version is 5.5.14 which I’ll be using to install on my machine.
  2. Mount the Disk Image (I mean open/double-click the DMG file) and install MySQL server by double-clicking the PKG file (in my case mysql-5.5.14-osx10.6-x86_64.pkg) and follow onscreen instructions. ( It will ask for Master password, as it installs MySQL server in /usr/local )
  3. Add /usr/local/mysql/bin to your path by editing .profile file. (Optionally you can create alias to mysql and mysqladmin as mentioned in README File)
  4. You can start MySQL server by running “/usr/local/mysql/bin/mysqld_safe &” from terminal but Disk image you downloaded also consists of Startup Package & Preferences Pane which allows you to start/stop MySQL server from System Preferences and even Automatically Start MySQL Server at Startup.
*Please note /usr/local/mysql is only symlink to /usr/local/mysql-5.5.14-osx10.6-x86_64 which means when you upgrade to new version symlink will be changed to point to new version but won’t be deleting the older version. However you need to copy your data directory to new location to make sure your existing databases are intact post upgrade.
Installing MySQL Startup Scripts & Preferences Pane (OPTIONAL)
  1. Double Click MySQLStartupItem.pkg and Follow on screen instructions (You will be asked for Master Password)
  2. Double Click MySQL.prefPane which will add MySQL to OS X System Preferences and it should like something like below
    MySQL Mac OS X Lion Preferences
    MySQL Mac OS X Lion Preferences
  3. Check Automatically Start MySQL Server on Startup to start MySQL server at boot time.
In next section we will discuss installing phpMyAdmin which will provide us web interface to perform basic MySQL administration tasks on Mac OS X Lion.

虹光大成就-密教灌頂(一)