Not a Linux fan? Looking for a hassle-free way of setting up a PHP environment on your Windows box? Read as Matthew guides us through the process of installing Apache, MySQL and PHP on a Windows based machine, otherwise known as WAMP.
Installing PHP under Windows - Installation Cont'd - MySQL (Page 4 of 6 )
Next we will be installing MySQL, a free database program. This will be necessary for almost all php scripts beyond any very basic scripts. Create a temporary directory – on the desktop is a good place; we will be getting rid of it soon anyway. Extract the MySQL ZIP file to the temp directory and run the setup.exe. Follow all the onscreen instructions. Once the setup program has finished and installed MySQL, delete the temporary directory.
Click Start -> Run and type cmd in the box, click Ok. This will open a console window (or MS-Dos box). In the console window enter the following commands and check that you receive the correct response:
Enter: cd c:\mysql\bin Enter: mysqld-max-nt --install Response: Service successfully installed. Enter: net start MySql Console should say: The MySql service is starting. Console should say: The MySql service was started successfully.
Congratulations you have installed MySQL; however, before we are done here we are going to make MySQL more secure, by adding a password, so only you can change the databases.
At the console window type the following commands (replace new_password with your new password):
Enter: cd c:\mysql\bin Enter: mysql -u root mysql Response: Welcome to the MySQL monitor ..... Enter: UPDATE user SET Password=PASSWORD('new_password') Enter: WHERE user='root'; Response: OK... Enter: FLUSH PRIVILEGES; Response: OK... Enter: DELETE FROM user WHERE user=''; Response: OK... Enter: DELETE FROM user WHERE Host='%'; Response: OK... Enter: DELETE FROM user WHERE User=''; Response: OK... Enter: DELETE FROM db WHERE Host='%'; Response: OK... Enter: exit Response: Bye Enter: exit Response: Console window closes.