簡體   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