gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 22:32:07 25 4
gpt4 key购买 nike

我一直在到处搜索,但我就是无法理解设置服务器以及网站上使用的一些架构的过程。

我使用的是工作台,但也是命令行方式。

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

最佳答案

在 Windows 中安装 MySQL Server 很容易,但是首次访问有一个小技巧。首先从这里下载 MySQL Server:

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

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

之后您必须重置 root 密码。由于某些奇怪的原因,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).

关于mysql - 在 Windows 上为网站设置 mySQL db 和 TomCat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29711655/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com