繁体   English   中英

在Windows上为网站设置mySQL db和TomCat

[英]Setting up mySQL db and TomCat on Windows for a website

我到处都在搜索,只是无法确定程序来设置服务器并在网站上使用一些模式。

我正在使用工作台,但也在使用命令行方式。

我有两台台式计算机。 我想要正常使用的一种。 第二个将作为mySQL数据库建立,仅此而已。 这里的需要是数据库PC应该允许某种远程访问,以便我的网站可以连接到它。

在Windows中安装MySQL Server很容易,但是先入为主。 首先从这里下载MySQL Server:

http://dev.mysql.com/downloads/mysql/

在安装过程中,请不要忘记检查将MySQL添加到系统路径变量的选项。

在那之后,您将不得不重置根密码。 由于某些奇怪的原因,root密码不起作用(至少在Windows上)。 请按照以下说明进行操作:

http://dev.mysql.com/doc/refman/5.1/en/resetting-permissions.html

使其更短:

1) Type services.msc in start menu to open the service lists
2) Stop MySQL server
3) Create a txt file with the content below, placing the commands in 2 lines.
UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;
4) Execute this command on a DOS prompt
"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld.exe" --defaults-file="C:\Program Files\MySQL\MySQL Server 5.5\\my.ini" --init-file=C:\\arquivo.txt --console
The init-file must point to the file created in item (3)
5) Delete the file created, restart MySQL service and logon normally with root user

要测试您的登录名,请使用DOS提示符并键入

mysql -h 127.0.0.1 -u root -pMyNewPass (no spaces between "P" and your password).

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM