How to install mySQL 5.0.x on Windows
This article explains how to install, configure and run mySQL 5.0.x under Microsoft Windows. Note! You might want to install Apache HTTP server first, and/or uninstall previous versions of mySQL.
Published 08.12.2005 - Last edited 08.12.2005 - 53861 views - 34 comments
1. Download and Unpack mySQL v5.0.x
Download and install the latest version of mySQL 5.0.x from http://dev.mysql.com/downloads/mysql/5.0.html.
Just make sure you get a Windows 95/98/NT/2000/XP/2003 (x86) binary,
Windows Essentials (x86) version (skip all the
questions part and scroll down to the mirrors list).
My file was named: mysql-essential-5.0.16-win32.msi
2. Install mySQL v5.0.x
Run the MSI file and use the following settings
- Typical Setup
- Skip Sign-Up
- make sure "Configure the mySQL Server now" is checked
- "Detailed Configuration"
- "Developer Machine"
- "Multifunctional Database"
- "InnoDB Tablespace Settings" - leave everything default
- "Decision Support (DSS)/OLAP"
- make sure "Enable TCP/IP Networking" is checked and leave the port number at 3306 (at this point, if you have a firewall, it will usually try to access itself on the localhost)
- "Standard Character Set"
- check "Install As Windows Service"
- I recommend leaving "Include Bin Directory in Windows PATH" checked
- enter your root password
- then hit "execute" and it´ll install and set it up
3. Getting PHP5 to work with mySQL
Unfortunately PHP5 removed built-in support for mySQL. So you´ll need to
copy some files by hand. open the folder you unzipped your PHP to. Copy the
libmysql.dll file (should be located like
c:\php5\libmysql.dll ) into your Window´s System folder (usually
C:\Windows\System32\ although might be c:\WinNT\System\ or something).
Then open up your php.ini in a text editor and search for ;extension=php_mysql.dll and remove the ; in front of that line.
Do the same for ;extension=php_mbstring.dll.
Without the mbstring extension phpMyAdmin is unable to split strings correctly
and it may result in unexpected results.
Restart Apache and see if you get any errors. If it complains about php_mysql.dll either your extention directory
isn´t correct or windows can´t find libmysql.dll
If you don´t want to move files outside your php5 directory, you may also
add the php5 directory to the PATH on Windows. Please read
the following article on how to do this.
4. Testing mySQL
Testing mySQL is not exactly easy. However, here are the common connection
strings for PHP and CGI. I recommend downloading phpMyAdmin and using it to create and
manage your databases, etc.
1 | Wednesday 15 Mar 2006 08:58:35 | kahar has this to say:
testing yooo
2 | Wednesday 05 Jul 2006 06:13:14 | Jawad Shuaib has this to say:
Excellent work!
3 | Sunday 12 Nov 2006 07:02:26 | Xach has this to say:
VERY good guide! Impressive, and thanks.
4 | Saturday 30 Dec 2006 16:58:33 | This doesn't seem to work has this to say:
I think that There is something wrong with my PHP installation. It doesn't load any of the modules. I know this because I tried changing the file names to ones that don't exist and when restarting apache it still loads correctly.
5 | Tuesday 23 Jan 2007 08:45:37 | Ramjee has this to say:
Hi,
It was really helpful. After struggling for a day(with incompatible versions of php and apache), your tutorial made it a cake walk.
Very detailed post.
6 | Wednesday 07 Feb 2007 18:42:56 | HANS RAJ has this to say:
Very Good! It helps!
I have got success in connceting mysql and php5 with the help of this article.
Thanks so much.
7 | Tuesday 27 Feb 2007 20:36:58 | greg has this to say:
1. can i connect php4 and mysql5?
2. u sayin to get rid of ; in extension=php_mysql.dll in php.ini but which php.ini? these one in c:/windows or c:/php4/ ??
8 | Wednesday 28 Feb 2007 09:40:06 | Thomas has this to say:
1. There's no problems connecting to MySQL5 from PHP4.
2. If you've followed my instructions on how to install PHP4 on windows then c:/php4/ is the right path to php.ini
9 | Monday 05 Mar 2007 17:07:59 | Viren Mathur has this to say:
After doing all that and loading a small database program the error that i got was .
Call to undefined function mysql_connect() in C:public_htmldatabase.php on line 2
please help
10 | Monday 05 Mar 2007 17:56:20 | max has this to say:
Have you tried to run phpMyAdmin on your local installation? Maybe you have some permission issues or similar?!
11 | Wednesday 07 Mar 2007 22:10:57 | Andrew has this to say:
From all the searching I've made in the NET your answer gave me the answer and I resolved the commection issue
MANY THANKs.
12 | Tuesday 20 Mar 2007 22:24:11 | Dani has this to say:
I'm using PHP 5 and MySQL 5, I have a problem I cannt connect to MySQL.Also I've tried to get the error by mysql_error(),but i'm getting nothing..Any idea..
13 | Wednesday 21 Mar 2007 09:44:34 | Thomas has this to say:
Have you followed the directions given in 3) from above?
You can also try to put the following in one of your php files:
$link = mysql_connect('localhost', 'sql_user', 'sql_pswd');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';This will reveal info if you for some reason don't have the right privileges.
Also make sure you're connecting through the default port, otherwise this also needs to be altered in the connect call.
14 | Monday 14 May 2007 21:34:27 | femi has this to say:
Somebody should please help me out, i have php 5.2, apache 2.2 and mysql 5.0.2 (Community server). i tried all my best to configure php and mysql, all to no avail. both of them are working indepently. i have tried all the steps above. each time i try to run a script from php, it always give a complain on MYsql connect () statement.
PLEASE SOMEBODY HELP
15 | Tuesday 15 May 2007 09:51:01 | Thomas has this to say:
It sounds like you haven't set up a proper admin user in MySQL.
Follow this link and see if that helps: How to Reset the Root Password
Let me know how it goes :)
16 | Thursday 21 Jun 2007 18:05:36 | Tom Atlas has this to say:
Ive tried everything, but what keeps happening, is that PHP just crashes whenever there is a mysql statement. Ive used this script:
error_reporting(6143);
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = 'Nartman';
if (function_exists('mysql_connect')) print "Its there
";
else print "Huh, weird
";
print "1";
$conn = mysql_connect($dbhost, $dbuser, $dbpass); //or die ('Error connecting to mysql');
print "2";
if ($conn) {
print "Successfull!";
}else{
print "Uh-Uh";
}
$dbname = 'petstore';
mysql_select_db($dbname);
?>
it returns "Hu, Weird
1"
and ut crashes after that. Please help
17 | Friday 22 Jun 2007 09:48:28 | Thomas has this to say:
Try this instead...
/* Open the DB connection */
$DBConn = @mysql_connect($dbhost, $dbuser, $dbpass);
if (!$DBConn) {
die(mysql_errno() . ": Could not connect to your MySQL database");
}
if (!@mysql_select_db($dbname, $DBConn)) {
die(mysql_errno($DBConn) . ": " . mysql_error($DBConn));
}
18 | Tuesday 10 Jul 2007 09:29:29 | Pja has this to say:
1)can i connect vb.net with MySQL 5.0?
2)If yes, how is it?
19 | Tuesday 10 Jul 2007 10:02:11 | Thomas has this to say:
Take a look at this blog post, think that answers your question...
20 | Sunday 30 Sep 2007 14:44:55 | Kazi has this to say:
Very good stuff..
21 | Tuesday 16 Oct 2007 10:51:29 | surander has this to say:
while pressing execute i got an error connot create windows service for MySql it stop at Start service
22 | Tuesday 16 Oct 2007 11:04:22 | Thomas has this to say:
Was it your first installation?
Please provide more info about your PC/SW versions (PHP, MYSQL, OS etc.) ?
Sometimes it works after reboot anyhow...
23 | Friday 23 Nov 2007 15:47:47 | Alan has this to say:
Perfect. I was having problems starting MySQL up, but following this process sorted it.
24 | Thursday 24 Jan 2008 17:52:16 | milind has this to say:
I Have problem in installtion of mysql at "excecute" step so what i can do please give me guaidline
25 | Thursday 24 Jan 2008 18:06:33 | Thomas has this to say:
Most of the times this issue is solved after reboot. Always do that first and then run the setup (mysql/bin/MySQLInstanceConfig.exe) again IF it's not working...
26 | Thursday 10 Apr 2008 14:00:10 | EXiT has this to say:
Thanks! The damn thing almost had me pulling my hair out xD
27 | Friday 26 Sep 2008 17:23:49 | Lukaz has this to say:
THANKS MAN !!!!
28 | Wednesday 05 Nov 2008 04:46:09 | Nick has this to say:
Easy to follow instructions. Thanks!
29 | Tuesday 17 Feb 2009 13:36:40 | Gauri has this to say:
very userfull tips to install WAMP package.
thank you so much
30 | Thursday 09 Apr 2009 08:18:22 | sultan has this to say:
I have installed MySQL 5.0 on my machine, Which is running on Windows XP. But while starting it as Windows Service is giving the following Error.
"Error 1067: Can't start MySQL".
I have disabled Anti Virus and tested it again, but got the same error.
Please help.
31 | Tuesday 02 Jun 2009 19:05:50 | Matt has this to say:
Very rare I say thanks for a tutorial, but this one is well worth it. saved me hours messing around!
32 | Friday 19 Jun 2009 22:59:28 | Anonymous has this to say:
Problem.
http://tinypic.com/r/28svtqf/5
Trying to install this on a windows 2003 server (32bit).
33 | Saturday 22 Aug 2009 11:39:50 | shreya has this to say:
since i m newer, pls help me installing mysql5.0 on windows xp, as i don't know much about mysql, every time i install it n found running on my pc but don't know how to install it.
34 | Tuesday 18 May 2010 22:03:54 | alendronate has this to say:
alendronate claescence sublux
generic soma unduplicated imide
neurontin interlunation flamenco
order levitra contort wearable
tylenol codeine puku commonable
propecia online delphinic morphometry steepen osc
levofloxacin hypopigmentation premoistening
abana farraginous thro
generic propecia periodontosis immanent emboss plural
amaryl dreamery tragedize
order levitra transnational udomograph
phentermine online pharmacy firework sedoheptose
effexor proctodaeum manservant ferrocement agarics
Configuring cron jobs on Windows
Up one level
PHP Sniplets