Installing MySQL Server 5.5 on Windows 7-VBForums
Results 1 to 22 of 22

Thread: Installing MySQL Server 5.5 on Windows 7

  1. #1

    Thread Starter
    Moderator
    Join Date
    Jan 2005
    Location
    Sydney
    Posts
    13,630

    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: 30364
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: 29807
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: 29700
Size:  47.9 KB

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

      Name:  mysql05.png
Views: 29553
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: 29508
Size:  39.8 KB

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

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,245

    Re: Installing MySQL Server 5.5 on Windows 7

    Great tutorial penagate.
    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.
    Please consider giving me some rep points if I help you a lot.
    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 2011
    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

    Thread Starter
    Moderator
    Join Date
    Jan 2005
    Location
    Sydney
    Posts
    13,630

    Re: Installing MySQL Server 5.5 on Windows 7

    Sleep well! Glad to have helped.

  5. #5
    New Member
    Join Date
    Jul 2011
    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 2011
    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

    Thread Starter
    Moderator
    Join Date
    Jan 2005
    Location
    Sydney
    Posts
    13,630

    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 2011
    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

    Thread Starter
    Moderator
    Join Date
    Jan 2005
    Location
    Sydney
    Posts
    13,630

    Re: Installing MySQL Server 5.5 on Windows 7

    Great to hear.

  10. #10
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,245

    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.
    Please consider giving me some rep points if I help you a lot.
    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

    Thread Starter
    Moderator
    Join Date
    Jan 2005
    Location
    Sydney
    Posts
    13,630

    Re: Installing MySQL Server 5.5 on Windows 7

    Bah. There are too many pictures in this one.

  12. #12
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,245

    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.
    Please consider giving me some rep points if I help you a lot.
    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

    Thread Starter
    Moderator
    Join Date
    Jan 2005
    Location
    Sydney
    Posts
    13,630

    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
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,245

    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.
    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.
    Please consider giving me some rep points if I help you a lot.
    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 2012
    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

    Thread Starter
    Moderator
    Join Date
    Jan 2005
    Location
    Sydney
    Posts
    13,630

    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 2012
    Posts
    52

    Re: Installing MySQL Server 5.5 on Windows 7

    thanks alot.. keep it up

  18. #18
    New Member
    Join Date
    Oct 2013
    Posts
    2

    Re: Installing MySQL Server 5.5 on Windows 7

    Quote Originally Posted by penagate View Post
    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-&gt;__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 !!!

  19. #19

    Thread Starter
    Moderator
    Join Date
    Jan 2005
    Location
    Sydney
    Posts
    13,630

    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.

  20. #20
    New Member
    Join Date
    Oct 2013
    Posts
    2

    Re: Installing MySQL Server 5.5 on Windows 7

    Thanks Penagate !
    You rock !!
    It worked by just removing the comment ( from ;extension_dir = "c:\php\ext\" to extension_dir = "c:\php\ext\"

    It just clicked in my mind that i should uncomment this part too :P

  21. #21
    Registered User
    Join Date
    Apr 2014
    Posts
    3

    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

  22. #22
    Registered User
    Join Date
    Apr 2014
    Posts
    3

    Re: Installing MySQL Server 5.5 on Windows 7

    Quote Originally Posted by jkumar29 View Post
    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
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.