简体   繁体   中英

Setting up mySQL db and TomCat on Windows for a website

I've been searching everywhere, and I just can't wrap my head around the procedure that lies in setting a server up with some schemas to be used along a website.

I'm using workbench, but also the command line way.

I have two desktop computers. One that I want for normal use. And the second to be put up as a mySQL database, and just that. The need here is that the database PC, should allow some kind of remote access, so that my website may connect to it.

Installing MySQL Server in windows is easy, however first access have a small tricks. Start by downloading MySQL Server from here:

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

During the install don't forget to check the options to add MySQL to the System Path Variables.

After that you'll have to reset the root password. For some weird reason the root password doesn't work (at least on windows). Follow the instructions here:

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

To make it shorter:

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

To test your login, use a DOS prompt and type

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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