-
Jun 2nd, 2011, 04:13 AM
#1
Installing MySQL Server 5.5 on Windows 7
Note: If you're planning to use MySQL with PHP, follow the tutorial Installing PHP 5.3 and Apache HTTP Server on Windows 7 first, if you haven't done so already.
At the time of writing, the latest stable version is 5.5.13.
Installing MySQL
- Get it from here:
http://dev.mysql.com/downloads/mysql/5.5.html
(Don't be fooled! You don't need to create an account. Follow the link "No thanks! Just take me to the downloads.")
Grab the installer — it's much smaller than the zip archive.
You can use either the 32 or 64-bit version. Both will work with a 32-bit PHP.
- Proceed through the wizard, selecting a 'Typical' installation.
You will see a 'MySQL Enterprise' popup at some point. Dismiss it.
- Once the wizard has finished, the MySQL Server Instance Configuration Wizard starts.
- Select 'Detailed Configuration'.
- Select 'Developer Machine'.
- Select 'Multifunctional database'.
- Select a drive.
- Select 'Manual setting', then enter a small number of concurrent connections.

- The default server port is 3306. If you change this, you'll need to specify the port in any applications that connect to the server.
- Select 'Best Support for Multilingualism'. This will set the default character set to UTF-8.
- Select "Include Bin Directory in Windows PATH".

- Enter a password, then finish the wizard.
The settings will be written to a file (my.ini).
If the wizard freezes for more than about 20 seconds at this point, close it and run it again... It's in bin under the directory where you installed MySQL.
- Test the installation by running the MySQL command-line client.

- Create a test database. We'll use this in the next section.

Configuring the MySQL Client
If this is a development machine, you might want to set up your client to log in as 'root' by default. To do this, set up a file called my.cnf and place it in your C:\ directory.
Code:
[client]
user=root
password=PASSWORD
(On Unix platforms, the MySQL client looks in your home directory for this file. Frustratingly, the Windows client does not do this.)
Connecting to MySQL from PHP
- Open the php.ini configuration file in a text editor.
Find the line ; extension_dir = "ext" and change it to:
Code:
extension_dir = "c:\php\ext\"
(If you installed PHP into a different directory, use that path instead.)
- Find the line ;extension=php_pdo_mysql.dll and uncomment it by removing the semicolon.
- Restart the Apache server.
- Copy the following listing into a new file under your htdocs directory.
Code:
<?php
header('Content-type:text/plain');
$dbh = new PDO('mysql:host=localhost;dbname=test', 'root', 'PASSWORD');
$st = $dbh->prepare('select bar from foo');
$st->execute();
var_dump($st->fetch(PDO::FETCH_ASSOC));
?>
- Navigate to that file using your web browser. You should see something like this:

Great success!
Last edited by penagate; Dec 9th, 2011 at 01:44 AM.
-
Jun 3rd, 2011, 06:14 AM
#2
Re: Installing MySQL Server 5.5 on Windows 7
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jul 14th, 2011, 07:49 AM
#3
New Member
Re: Installing MySQL Server 5.5 on Windows 7
do you realize how long I have been trying to get my php script to accept my sql5.5 and my php 5 installation. Install, delete,reboot install ahhhhhgg!!!
thought I had it once at 4am but it was just a coffee buzz. changed the script on dreamweaver and changed the path on the environment etc etc.
I'm a newbie and all but it should not be that hard to point to the database with php .
just when I was giving up i googled for the 60th time and what did I see..your post and being desperate I closed my eyes and typed what seemed like the 1000th change. what was it i saw............
IT works!!!!!!!
you are a bloody miracle...thank you from the bottom of my heart!!!now I can go to sleeep !!!
-
Jul 14th, 2011, 08:13 AM
#4
Re: Installing MySQL Server 5.5 on Windows 7
Sleep well! Glad to have helped.
-
Jul 14th, 2011, 08:26 AM
#5
New Member
Re: Installing MySQL Server 5.5 on Windows 7
to add to this :--->my code is ;
<?php
$link=mysql_connect('localhost:3306;dbname=test', 'root', 'password');
if (!$link)
{
$output="unable to connect to the database server.";
include 'output.html.php';
exit();
}
?>
remember the port# and all is well. ....thanks again..this does work perfectly
-
Oct 11th, 2011, 02:47 AM
#6
New Member
Re: Installing MySQL Server 5.5 on Windows 7
On the last step I get
<br />
<b>Fatal error</b>: Class 'PDO' not found in <b>C:\Apache2\htdocs\test2.php</b> on line <b>3</b><br />
Everything else has worked great, though. So close, please help.
-
Oct 11th, 2011, 04:11 AM
#7
Re: Installing MySQL Server 5.5 on Windows 7
Silly question perhaps, but did you do steps 1 and 2 in the last section?
If so, what versions of the software are you using?
Did you also install an up-to-date PHP?
Are you using a 64-bit Windows, and if so, did you install 64-bit versions of any of the packages?
I have had trouble getting PDO to work on a 64-bit system in the past because of incompatible libraries. I don't remember the exact solution, but if you install everything according to my two tutorials (Apache/PHP and this one), it ought to work. In particular I use VC9 builds of Apache and PHP.
-
Oct 11th, 2011, 06:09 PM
#8
New Member
Re: Installing MySQL Server 5.5 on Windows 7
I used the VC6 builds and the x86 MySQL 5.5.16.
I tried the exact ones you specified and it worked like a charm. Should have done that in the first place.
Thanks very much!
-
Oct 11th, 2011, 06:45 PM
#9
Re: Installing MySQL Server 5.5 on Windows 7
-
Oct 27th, 2011, 02:32 AM
#10
Re: Installing MySQL Server 5.5 on Windows 7
I have the same notes on my hard drive although, my lecturer included more pictures in his version.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Oct 27th, 2011, 03:06 AM
#11
Re: Installing MySQL Server 5.5 on Windows 7
Bah. There are too many pictures in this one.
-
Oct 27th, 2011, 08:02 PM
#12
Re: Installing MySQL Server 5.5 on Windows 7
I think you also should include a section on how to solve specific errors for example error nr. 1045 which, I am currently trying to solve.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Oct 27th, 2011, 08:07 PM
#13
Re: Installing MySQL Server 5.5 on Windows 7
OK. The only problem with that is that I have never run into error 1045.
Could it be the Windows firewall?
-
Oct 27th, 2011, 08:16 PM
#14
Re: Installing MySQL Server 5.5 on Windows 7
 Originally Posted by penagate
OK. The only problem with that is that I have never run into error 1045.
Could it be the Windows firewall?
I think it might have something to do with admin rights on the operating system.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jan 12th, 2012, 03:31 PM
#15
New Member
Re: Installing MySQL Server 5.5 on Windows 7
Hi,
The last step doesnt works for me,it does not display anything on the webpage ,all other step in both the tutorial went fine and resulted as anticipated..
Wondering .. ?? .. :S
-
Jan 12th, 2012, 05:59 PM
#16
Re: Installing MySQL Server 5.5 on Windows 7
How did you install PHP?
Do you have the display_errors option on?
-
Aug 18th, 2012, 03:24 PM
#17
Member
Re: Installing MySQL Server 5.5 on Windows 7
-
Oct 28th, 2013, 06:27 AM
#18
New Member
Re: Installing MySQL Server 5.5 on Windows 7
 Originally Posted by penagate
Silly question perhaps, but did you do steps 1 and 2 in the last section?
If so, what versions of the software are you using?
Did you also install an up-to-date PHP?
Are you using a 64-bit Windows, and if so, did you install 64-bit versions of any of the packages?
I have had trouble getting PDO to work on a 64-bit system in the past because of incompatible libraries. I don't remember the exact solution, but if you install everything according to my two tutorials (Apache/PHP and this one), it ought to work. In particular I use VC9 builds of Apache and PHP.
Hi Penagate,
I am using win-7 32 bit system.
Installed PHP 5.3 (5.3.27) VC9 x86 Non Thread Safe version from php official site
Installed httpd-2.2.25-win32-ssl_0.9.8-VC9 (Apache server) ..
Did the setting as shown in the http://http://www.vbforums.com/showt...r-on-Windows-7 and successfully i was able to RAN php scripts via apache server ..
Today i wanted to configure MYSQL db to PHP and apache so i have downloaded and installed mysql-5.5.13-win32 as per the instructions above .
But I am getting following error
<br />
<b>Fatal error</b>: Uncaught exception 'PDOException' with message 'could not find driver' in C:\apache2\htdocs\mysql-php.php:3
Stack trace:
#0 C:\apache2\htdocs\mysql-php.php(3): PDO->__construct('mysql:host=loca...', 'root', 'root')
#1 {main}
thrown in <b>C:\apache2\htdocs\mysql-php.php</b> on line <b>3</b><br />
P.S : my db name is :test_schema ; table name : sample password and username : root
I have create my.cnf file as you suggested in C: drive with following contents :
[client]
user=root
password=root
PLEASE HELP ME WHERE AM I GOING WRONG !!!
-
Oct 28th, 2013, 11:06 PM
#19
Re: Installing MySQL Server 5.5 on Windows 7
That message means that the pdo_mysql library is missing from your PHP installation.
Check for this line in php.ini:
Code:
;extension=php_pdo_mysql.dll
Make sure it's uncommented (remove the leading semicolon).
Also, I'm not sure you have the right versions of all the software. I wrote these two tutorials a couple of years ago and they're a bit out of date now.
I would recommend the following for you:
Apache httpd VC11 x86
http://www.apachelounge.com/download...win32-VC11.zip
PHP 5.5 VC11 x86 thread-safe
http://windows.php.net/downloads/rel...2-VC11-x86.zip
Install those following the same procedure and see how you go.
Also also... the my.cnf file is only read by the command-line MySQL client — you will still need to supply credentials when connecting from PHP.
-
Oct 28th, 2013, 11:38 PM
#20
New Member
-
Apr 29th, 2014, 06:17 AM
#21
Registered User
Re: Installing MySQL Server 5.5 on Windows 7
After complete installation ofApache2.4 and PHP5.5. When I run wordpress website I have got error message of "Your PHP installation appears to be missing the MySQL extension which is required by WordPress.". Please help - Thanks
-
Apr 29th, 2014, 08:08 AM
#22
Registered User
Re: Installing MySQL Server 5.5 on Windows 7
 Originally Posted by jkumar29
After complete installation ofApache2.4 and PHP5.5. When I run wordpress website I have got error message of "Your PHP installation appears to be missing the MySQL extension which is required by WordPress.". Please help - Thanks
I have found the solution.
1. Go PHP folder and open php.ini file
2. find ;extension=php_mysql.dll and ;extension=php_mysqli.dll
3. Remove semicolon
Example:
extension=php_mysql.dll
extension=php_mysqli.dll
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|