PHP >
Configuring MySql /Apache on vista
Added on 03/08/2008
|
|
This Page has been Viewed 1104 times |
Current rating:  4   out of 5 from   1   raters         |
How to Install and Configure MySql on Windows Vista and Apache
MySql 5.0.45 with Apache running on Vista
2st part - Configuration
Start earning money with your Website.
Matched.co.uk pays 5 english pounds when you sign up and 3 pounds per month for each ad you publish
Find out more at http://www.matched.co.uk
Find more tutorials at
- Log in with administrator
permissions. Turn UAC (User Account Control) off , if you don't
know how , read this How to turn UAC off
You better add an exception for MySql in Windows Firewall before
you start, see this
Manage
Windows Firewall to avoid Win Firewall won't block the
configuration. If you have any other Firewall,turn them off and
read the users help to allow programs.
-
Now go to Programs > MySql and click on
the MySql Server Instance Configuration Wizard.The Configuration process
starts.

-
I chose Detailed Configuration to have
access to change the options following.Then, on this window you choose how you going to use MySql to
determine how many resources to allocate for
the server and click Next.

-
Now ,if you have a firewall on your computer ,make sure to allow port
number 3306 .At the beginning uncheck Enable Strict Mode to make it
easier for you and then,when you more confident,you can enable it again.
and.Click Next.

-
Then, on this window choose to run MySql as Windows Service and click Next.

-
Now enter the root password,this is a very important step,because this
password will allow you to access the database root as administrator and
do basically everything,so make sure to choose a strong password
and.Click Next.

-
Now you've done and the configuration wizard is ready to execute
the settings you chose just Click Execute
and if everything is OK you should see something like the window
below.

- Go to Start / Programs / MySql and click on
MySql Command Line ClientA command prompt appears, like the figure below, you'll be
asked for a password. Type the password you chose during the
configuration and press enter, if you see something like below, MySql Server is successfully running on your computer.

When the MySql configuration is
finished ,you have to configure PHP to run MySql
if you haven't done it yet when installing PHP.
- To start go to the
PHP directory,in this case C:\ PHP and open php.ini with
Notepad .
- Find extension_dir =
"./" and change it in extension_dir = "C:/PHP./ext" where ext is the folder
where all the extension are.
- Find and uncomment (delete the
;) ;extension=php_mysql.dll and ;extension=php_mysqli.dll or type them in the
case they aren't with the extensions.I suggest to do the same with
extension=php_gd2.dll for your graphics.
.

A this stage open your browser and open the page you have done to test the PHP installation, phptest.php and now you should be able to see all the information about MySql like in the figure below .If you can't see them ,the reason is PHP can't load MySql extension and you'll have to go through the PHP configurations steps and make sure that you've followed all the steps.

A further test to connect to MySql from PHP , open Notepad , new
document and copy and paste the following code:
<?php
$host='localhost';
//host name
$username='user';
//database user name
$password='mypassword'; //database password
mysql_connect($host,$username,$password) or die (mysql_error());
echo"connected<br/>";
?>
Then save the file in your website root directory and name it
test_sql.php.Now open the file in your browser and,if everything OK
you should read 'connected ' on a white page ,