Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 3安裝Web服務器的FreeBSD 6.0與Apache 2.2 , MySQL的5.0和PHP 5 -第3部分
Installing Apache 2.2, MySQL 5 and PHP 5 in FreeBSD 6.0 for a Reliable Web Server 安裝的Apache 2.2 , MySQL的第5和PHP 5中的FreeBSD 6.0可靠的Web服務器
Part 3 - Installing MySQL Server 5 with FreeBSD Ports Collection第3部分-安裝M ySQL服務器與F reeBSD第5集港口
- Login to the FreeBSD system as root, or su - root to get to super user environment.登錄在FreeBSD系統的根,或者蘇-根進入超級用戶環境。
- Enter the following commands at FreeBSD command line interface (CLI) (Wait till each command to finish processing before running the next command):輸入下面的命令在FreeBSD的命令行界面( CLI ) (等待到每個命令完成之前,處理未來運行命令) :
cd /usr/ports/databases/mysql50-server的CD / usr/ports/databases/mysql50-server
make install clean使安裝清潔
mysql_install_db --user=mysql mysql_install_db -M ySQL的用戶=
chown -R mysql /var/db/mysql/ chown - R的數據庫是/ var /數據庫/數據庫/
chgrp -R mysql /var/db/mysql/ chgrp - R的數據庫是/ var /數據庫/數據庫/
/usr/local/bin/mysqld_safe -user=mysql &的/ usr / local /斌/ mysqld_safe用戶=數據庫&Note: If you encounter Command not found error, use command rehash to update OS path environment variables.注:如果您遇到命令未發現錯誤,使用命令翻版更新操作系統路徑環境變量。
- The port installation will put a script file mysql-server.sh in /usr/local/etc/rc.d which will has capability to start MySQL server.該港口將安裝腳本檔案數據庫, server.sh在/ usr / local的/ etc / rc.d這將有能力以啟動MySQL服務器。 To enable MySQL server to start automatically after every FreeBSD server reboot, enter the following command in CLI:為了使MySQL服務器自動啟動後,每一個FreeBSD的服務器重新開機,輸入下面的命令在引導倡議:
echo ‘mysql_enable=”YES”‘ >> /etc/ rc.conf迴聲' mysql_enable = “是” “ > ”的/ etc / rc.conf
- By default, MySQL default super user account - root - has no password (blank password).默認情況下, MySQL的默認的超級用戶帳戶-根-沒有密碼(空白密碼)。 So it’s important to assign the administrator account password.因此,重要的是要指定管理員帳戶密碼。 To change the password to root user, enter the following command:要更改密碼,以root用戶,輸入以下命令:
mysqladmin -u root password newpassword mysqladmin聚氯乙烯root密碼newpassword
Replace newpassword with your own desired password. newpassword替換用自己想要的密碼。
- Optionally, copy either my-huge.cnf, my-large.cnf, my-medim.cnf, my-small.cnf or my-innodb-heavy-4G.cnf (depending on the usage and utilization of MySQL server) as my.cnf to /var/db/mysql which will enable you to tweak and change the configuration of server-specific MySQL server options by editing the file.或者,要么我的副本, huge.cnf ,我國- large.cnf ,我國- medim.cnf ,我,我small.cnf或- InnoDB的,重4G.cnf (取決於使用和利用MySQL服務器)為我。合為是/ var /數據庫/數據庫這將使你能夠調整和更改配置的服務器的具體MySQL服務器選擇編輯文件。
- MySQL 5.0 installation done. 5.0 MySQL的安裝工作。
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要說明:這是一台機器翻譯網頁這是“原樣”提供,無保修。 Machine translation may be difficult to understand.機器翻譯可能很難理解。 Please refer to請參閱 original English article英文原文的文章 whenever possible.只要有可能。
Share and contribute or get technical support and help at共享和貢獻或獲得技術支持和幫助 My Digital Life Forums 我的數字生活論壇 . 。
Related Articles相關文章
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 4安裝Web服務器的FreeBSD 6.0與Apache 2.2 , MySQL的5.0和PHP 5 -第4部分
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 5安裝Web服務器的FreeBSD 6.0與Apache 2.2 , MySQL的5.0和PHP 5 -第5部分
- Easily Set Up Web Server with XAMPP輕鬆地設置Web服務器與XAMPP
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 1 Web服務器安裝在Windows XP中使用的Apache2 , PHP5和MySQL4 -第1部分
- Change and Reset MySQL root Password變化和重置MySQL的root密碼
- FreeBSD Apache HTTP Accept Filter Error FreeBSD上的Apache的HTTP錯誤接受過濾器
- Enable Logging of Slow Queries (Slow Query Log) in MySQL Database啟用日誌記錄慢查詢(慢速查詢日誌)在MySQL數據庫
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4 Web服務器安裝在Windows XP中使用的Apache2 , PHP5和MySQL4 -第4部分
- Enable MySQL InnoDB Storage Engine Support in XAMPP Installation啟用MySQL的InnoDB存儲引擎的支持XAMPP安裝
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 3 Web服務器安裝在Windows XP中使用的Apache2 , PHP5和MySQL4 -第3部分

































May 21st, 2006 13:12 2006年5月21日13:12
mysql_enable = mysql_enable =
May 21st, 2006 14:07 2006年5月21日14:07
Thanks for pointing out, will update.謝謝指出,將更新。
June 6th, 2006 11:08 2006年6月六號11:08
i’m stucked with the mysql part of your howto, after issuing # mysqladmin -u root password newpassword, i issued # mysql -u root -p newpassword, i always get the access denied error.我stucked與數據庫的一部分,您如何後,簽發# mysqladmin聚氯乙烯root密碼newpassword ,我發表#數據庫聚氯乙烯根一p newpassword ,我總是得到拒絕訪問的錯誤。 what did i miss?什麼是我想念?
thanks謝謝
June 6th, 2006 11:49 2006年6月六號11:49
jan, may be you have set the password for root. 1月,可能是您設置的密碼根源。 Try to access mysql with -u userid and -p password option.嘗試訪問MySQL與聚氯乙烯帳號和一p 密碼選項。 Or you can follow instruction或者,您也可以按照指令 here這裡 on how to change and reset your root password.關於如何改變和重設您的root密碼。
June 6th, 2006 14:32 2006年6月六號14:32
i’ve tried all the options mentioned but none of them worked, so i did a fresh install again, before creating a password for mysql root user, i logged in as root and it worked fine, i was able to get a mysql shell but when i issue the command mysqladmin to create a password for root, i got an error, i tried to log in as root and wtf i’m back with the same problem.我試過所有的選項提到但它們都沒有工作,所以我也重新安裝一次,然後創建一個密碼為MySQL root用戶,我登錄的根源,它的工作很好,我能夠獲得MySQL的殼,但當我發出命令mysqladmin創建一個密碼為根,我收到一個錯誤,我嘗試登入根和跆拳道我回來了同樣的問題。 do u think i would be better off if i install phpmyadmin and change the root password from there?這樣ü想我會更好,如果我安裝phpmyadmin ,改變了root密碼從那裡?
June 6th, 2006 16:56二零零六年6月6日16時56分
Did you flush privileges after changing the password?你沖水特權後,改變了密碼? The problem may be due to hashing of MySQL password.這個問題可能是由於散列的MySQL密碼。 May be you can try the following commands after resetting your root password if it cannot works:可能是您可以嘗試下面的命令後,重設您的root密碼,如果它不能工作:
mysql -u root mysql MySQL的聚氯乙烯根數據庫
> UPDATE user SET password=password(’secret’) WHERE user=’root’; “更新用戶設置密碼=密碼( '秘密' )凡用戶= '根' ;
> flush privileges; “沖水特權;
You may try phpmyadmin too, but I remembered I used to have exactly this same problem while phpMyAdmin didn’t help much.您可以嘗試phpmyadmin太多,但我記得我曾經有正是這種相同的問題,而phpMyAdmin沒有幫助很大。 Do let me know how you solve it.不要讓我知道你如何解決這個問題。
June 7th, 2006 13:14 2006年6月7日13:14
you’re right changing it via phpmyadmin gave me the same result, so what i did was change some settings in the config.inc.php of phpmyadmin, change the auth_type = cookie and blowfish = mypassphrase and everything were fine.你有權改變它通過phpmyadmin給了我同樣的結果,所以我就是這樣做的是改變一些設置config.inc.php的phpmyadmin ,改變auth_type = cookie和河豚= mypassphrase和一切被罰款。
August 18th, 2006 00:57 2006年8月18日00:57
The problem is that mysql (version 5.x) is not starting with mysql_enable=”YES” in /etc/rc.conf.問題是,數據庫( 5.x版)是不是開始mysql_enable = “是”在/ etc / rc.conf 。
Im using FreeBSD v6.1.x.進出口使用的FreeBSD v6.1.x. I do not have the space problem between enable and the “=”.我沒有空間之間的問題能夠和“ = ” 。 The message I receive on bootup is “YES: notfound”.郵件我收到關於啟動“是: notfound ” 。
Any suggestions welcome.任何建議表示歡迎。
August 19th, 2006 10:45 06年八月19日10:45
Ive followed this guide but when i run “mysql-server.sh start” it returns starting mysql and does nothing else.伊夫遵循了這一指導但是當我運行“數據庫, server.sh啟動”返回啟動MySQL並沒有別的。 i ran “mysql-server.sh status” and it returned “mysql is not running”我跑“數據庫, server.sh地位” ,並返回“數據庫沒有運行”
mysql_enable=”YES” is in rc.conf but is not starting. mysql_enable = “是”在rc.conf但沒有啟動。 any help?任何幫助嗎?
August 19th, 2006 11:25 06年八月19日11:25
Check if you can run mysqladmin or other mysql tools.檢查是否可以運行mysqladmin或其他數據庫工具。 Also make sure your “YES” in rc.conf is using proper “, as the ” in the article has been changed.還請確保您“是”在rc.conf使用適當的“ ,因為”在文章中已變更。
August 19th, 2006 15:10 06年八月19日15:10
rc.conf contains rc.conf載
mysql_enable=”YES” mysql_enable = “是”
apache22_enable=”YES” apache22_enable = “是”
here is results from mysqladmin -user admin這裡的結果mysqladmin用戶管理
mysqladmin: connect to server at ‘localhost’ failed mysqladmin :連接到服務器上的'本地'失敗
error: ‘Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)’錯誤: '無法連接到本地MySQL服務器通過插座' / tmp的/ mysql.sock ' ( 2 )
Check that mysqld is running and that the socket: ‘/tmp/mysql.sock’ exists!檢查mysqld正在運行的插座: ' / tmp的/ mysql.sock '存在!
September 12th, 2006 21:43二零零六年九月12日21:43
just delete刪除
January 27th, 2007 02:06 07年1月27日02:06
Hi,嗨,
I have installed freebsd 5.5 and now with your guideline instructions I have install mysql, php5 and apache2.2.But i do not know how to configure a website so I can test that if it works.Please help me with a link who can provide step by step instuctions or refer me some good basic book.我已經安裝的FreeBSD 5.5 ,現在與您的指導方針的指示我已經安裝數據庫, php5和apache2.2.But我不知道如何設定一個網站,這樣我就可以測試,如果它works.Please幫助我聯繫誰可以提供一步一步instuctions或提及我一些良好的基本書籍。
Thanks.謝謝。
March 5th, 2007 21:24 2007年3月5號21:24
If you’re getting “mysql_install_db: Command not found.” after punching in “mysql_install_db”, you should try to cd to /usr/local/bin/ and then run “mysql_install_db”.如果您收到“ mysql_install_db :命令沒有找到。 ”沖壓後在“ mysql_install_db ” ,你應該嘗試的CD為/ usr / local /斌/然後運行“ mysql_install_db ” 。
Cheers.乾杯。
March 5th, 2007 21:25 2007年3月5號21:25
Oh; and thanks for the great article!噢;並感謝偉大的文章!
November 12th, 2007 13:32 07年11月12號13:32
i ecountered the not found error while installing mysql, what should i do?字母i ecountered沒有發現的錯誤,而安裝MySQL ,我應該怎麼辦? and what is the command rehash actually is?什麼是重複的命令實際上是什麼? thank you so much.感謝你這麼多。
November 12th, 2007 16:33 07年11月12號16:33
rehash is a command to ‘refresh’ the system.翻版是一個命令'刷新'的制度。 Did it work after rehash.沒有工作後的翻版。
January 11th, 2008 10:32 2008年1月11號10:32
great tutorial!偉大的教程! thanks!謝謝!
January 23rd, 2008 00:43 2008年1月23日0點43分
Where can I find these files on a MySql 5.1 install on FreeBSD 6.2?我在哪裡可以找到這些檔案對一個MySQL 5.1安裝在FreeBSD 6.2 ?
my-huge.cnf, my-large.cnf, my-medim.cnf, my-small.cnf or my-innodb-heavy-4G.cnf我- huge.cnf ,我國- large.cnf ,我國- medim.cnf ,我,我small.cnf或- InnoDB的,重4G.cnf
March 23rd, 2008 02:39 2008年3月23號02:39
the my-huge.cnf, my-large.cnf, my-medim.cnf, my-small.cnf or my-innodb-heavy-4G.cnf are found in /usr/local/share/mysql/在我國, huge.cnf ,我國- large.cnf ,我國- medim.cnf ,我,我small.cnf或- InnoDB的,重4G.cnf被發現在/ usr / local /共享/數據庫/
August 2nd, 2008 07:21 2008年8月2號07:21
On FreeBSD 7.0 you don’t need to manually install the databases and set permissions, that is done in the startup script the first time it is run.在FreeBSD 7.0就不需要手動安裝數據庫,並設置權限,這樣做的啟動腳本第一次運行。
Just make sure you have您只要確定有
mysql_enable=”YES” mysql_enable = “是”
in /etc/rc.conf before you run mysql-server.在/ etc / rc.conf然後再運行數據庫服務器。
You could hence rewrite the install instructions to this:你可以因此改寫安裝此:
cd /usr/ports/databases/mysql50-server的CD / usr/ports/databases/mysql50-server
make install clean使安裝清潔
echo ‘mysql_enable=”YES”‘ >> /etc/rc.conf迴聲' mysql_enable = “是” “ > ”的/ etc / rc.conf
/usr/local/etc/rc.d/mysql-server start的/ usr / local的/ etc / rc.d /數據庫服務器啟動
August 21st, 2008 13:06 2008年8月21號13:06
Hey there.嘿存在。 I was having trouble with the “mysql_install_db: command not found” when installing FreeBSD 7.我是有問題的“ mysql_install_db :命令未找到”當安裝的FreeBSD 7 。 I ran the rehash command and then entered mysql_install_db again and it worked fine.我跑的翻版命令,然後再次進入mysql_install_db和它的罰款。