• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Website woes - How to get MySQL going?

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Cjwinnit

B&
Joined
Feb 1, 2003
Location
UK
I've got my site up and running with Apache and PHP in windows, I'm building a server so it might go on there with Linux. But I can't for the life of me get the site to use SQL.

Installed a MySQL client, worked fine in the console. Could add and delete entries et cetera.....


When I added the (what i though were the correct) libraries for Apache to use, it still said "undefined function: msql().." like it did the first time i tried it.

so I uncommented the line in php.ini for it to work but it then said "Internal Server Error."

On advice of fellow geek, I tried a bundled package but I couldn't get it to run any page at all so I bit the bullet and clean-slated everything. PHP, Apache, MySQL, PHPtriad, phpmyadmin, all gone.


The Challenge:

Fix this:
Code:
 Call to undefined function: msql_connect()

New install of Apache and PHP and works fine. From that, what is a good MySQL client to install and how the hell do I get PHP and Apache to run MySQL code?

Currently installed:
Apache: apache_2.0.48-win32-x86-no_ssl.exe
PHP: php-4.3.4-installer.exe

Running on a windows system.

For the sake of argument Apache is installed on c:\program files\web\apache2

Apache is in c:\php\

Please help :(
 
Last edited:
create a php page with the following:

Code:
<?php phpinfo() ?>

then surf to that page and do a find for mysql, if you cannot find anything then php hasn't be built with mysql support.
 
Ah, of course, forgot about that.

There is a MySQL bit:
Code:
MySQL Support	            enabled	
Active Persistent Links 	0 	
Active Links 	      0 	
Client API version 	3.23.49 	

Directive	             Local Value  Master Value	
mysql.allow_persistent On          On
 
Fixed it. In case this comes up in a search later on if someone else has this problem:
Download the PHP libraries, unzip a file called php_msql.dll, send it to C:\Windows\system32

Open php.ini in C:\Windows and add this line:
Code:
extension=php_msql.dll

Save and restart Apache.
 
Ugh not that file. It took me forever to find php.ini in windowz because almost all the help files on the net were for linux. I had the problem of defining the correct SMTP server.

The line you mentioned should already be in there, just not active. Do a search for it with wordpad and remove the ; that preceeds it so it isn't read as a comment. Then save and restart apache and your all set.

Glad to hear its working! Sorry appserv didn't work :D.
 
diggingforgold said:
The line you mentioned should already be in there, just not active. Do a search for it with wordpad and remove the ; that preceeds it so it isn't read as a comment. Then save and restart apache and your all set.

Glad to hear its working! Sorry appserv didn't work :D.

Yeah, that's what I did, took a while to work out I was using the wrong library, that's what the "Internal Server Error." was :rolleyes:
 
Ok, more problems. PHP now recognizes MySQL commands but MySQL won't start.
Code:
C:\MYSQL\BIN>mysqld

C:\MYSQL\BIN>mysqladmin -uroot password test
MYSQLADMIN: connect to server at 'localhost' failed
error: 'Can't connect to MySQL server on 'localhost' (10061)'
Check that mysqld is running on localhost and that the port is 3306.
You can check this by doing 'telnet localhost 3306'

C:\MYSQL\BIN>telnet localhost 3306
Connecting To localhost...Could not open connection to the host, on port 3306: Connect failed

It's a fresh install. Mysqld will not run. I uninstalled it, then re-installed it, no luck.

Anyone know how to make it run?
 
Have you check that the service is running in control panel > admin tools > Services.

Look for mysql, make sure it is loaded and set to autoload at startup.

Let us know how you get on.
 
Back