Results 1 to 17 of 17

Thread: Installing MySQL Server 5.5 on Windows 7

  1. #1
    Moderator
    Join Date
    Jan 05
    Location
    Sydney
    Posts
    13,612

    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

    1. 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.


    2. Proceed through the wizard, selecting a 'Typical' installation.
      You will see a 'MySQL Enterprise' popup at some point. Dismiss it.


    3. Once the wizard has finished, the MySQL Server Instance Configuration Wizard starts.

    4. Select 'Detailed Configuration'.

    5. Select 'Developer Machine'.

    6. Select 'Multifunctional database'.

    7. Select a drive.

    8. Select 'Manual setting', then enter a small number of concurrent connections.

      Name:  mysql02.png
Views: 18256
Size:  57.1 KB

    9. 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.

    10. Select 'Best Support for Multilingualism'. This will set the default character set to UTF-8.

    11. Select "Include Bin Directory in Windows PATH".

      Name:  mysql03.png
Views: 18246
Size:  53.7 KB

    12. 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.


    13. Test the installation by running the MySQL command-line client.

      Name:  mysql04.png
Views: 18189
Size:  47.9 KB

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

      Name:  mysql05.png
Views: 18135
Size:  41.2 KB


    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

    1. 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.)


    2. Find the line ;extension=php_pdo_mysql.dll and uncomment it by removing the semicolon.

    3. Restart the Apache server.

    4. 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));
      ?>
    5. Navigate to that file using your web browser. You should see something like this:

      Name:  mysql06.png
Views: 18216
Size:  39.8 KB

    Great success!
    Last edited by penagate; Dec 9th, 2011 at 12:44 AM.

  2. #2
    Web developer Nightwalker83's Avatar
    Join Date
    Dec 01
    Location
    Adelaide, Australia
    Posts
    9,723

    Re: Installing MySQL Server 5.5 on Windows 7

    Great tutorial penagate.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    Please consider giving me some rep points if I help you a lot.
    DON'T BUMP YOUR POSTS!!! Links to my code examples can now be found on my website: My websites
    Please rate my post if you find it helpful!
    Technology is a dangerous thing in the hands of an idiot! I am that idiot.

  3. #3
    New Member
    Join Date
    Jul 11
    Posts
    2

    Thumbs up 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 !!!

  4. #4
    Moderator
    Join Date
    Jan 05
    Location
    Sydney
    Posts
    13,612

    Re: Installing MySQL Server 5.5 on Windows 7

    Sleep well! Glad to have helped.

  5. #5
    New Member
    Join Date
    Jul 11
    Posts
    2

    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

  6. #6
    New Member
    Join Date
    Oct 11
    Posts
    2

    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.

  7. #7
    Moderator
    Join Date
    Jan 05
    Location
    Sydney
    Posts
    13,612

    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.

  8. #8
    New Member
    Join Date
    Oct 11
    Posts
    2

    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!

  9. #9
    Moderator
    Join Date
    Jan 05
    Location
    Sydney
    Posts
    13,612

    Re: Installing MySQL Server 5.5 on Windows 7

    Great to hear.

  10. #10
    Web developer Nightwalker83's Avatar
    Join Date
    Dec 01
    Location
    Adelaide, Australia
    Posts
    9,723

    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.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    Please consider giving me some rep points if I help you a lot.
    DON'T BUMP YOUR POSTS!!! Links to my code examples can now be found on my website: My websites
    Please rate my post if you find it helpful!
    Technology is a dangerous thing in the hands of an idiot! I am that idiot.

  11. #11
    Moderator
    Join Date
    Jan 05
    Location
    Sydney
    Posts
    13,612

    Re: Installing MySQL Server 5.5 on Windows 7

    Bah. There are too many pictures in this one.

  12. #12
    Web developer Nightwalker83's Avatar
    Join Date
    Dec 01
    Location
    Adelaide, Australia
    Posts
    9,723

    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.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    Please consider giving me some rep points if I help you a lot.
    DON'T BUMP YOUR POSTS!!! Links to my code examples can now be found on my website: My websites
    Please rate my post if you find it helpful!
    Technology is a dangerous thing in the hands of an idiot! I am that idiot.

  13. #13
    Moderator
    Join Date
    Jan 05
    Location
    Sydney
    Posts
    13,612

    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?

  14. #14
    Web developer Nightwalker83's Avatar
    Join Date
    Dec 01
    Location
    Adelaide, Australia
    Posts
    9,723

    Re: Installing MySQL Server 5.5 on Windows 7

    Quote Originally Posted by penagate View Post
    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.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    Please consider giving me some rep points if I help you a lot.
    DON'T BUMP YOUR POSTS!!! Links to my code examples can now be found on my website: My websites
    Please rate my post if you find it helpful!
    Technology is a dangerous thing in the hands of an idiot! I am that idiot.

  15. #15
    New Member
    Join Date
    Jan 12
    Posts
    1

    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

  16. #16
    Moderator
    Join Date
    Jan 05
    Location
    Sydney
    Posts
    13,612

    Re: Installing MySQL Server 5.5 on Windows 7

    How did you install PHP?
    Do you have the display_errors option on?

  17. #17
    Member
    Join Date
    Jul 12
    Posts
    52

    Re: Installing MySQL Server 5.5 on Windows 7

    thanks alot.. keep it up

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •