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和它的罚款。