Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
|
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 2nd, 2005, 11:34 AM
Registered User
 
Join Date: Feb 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Mysql not firing up

hi,
im working from the wrox 'beginning php, apache, mysql webdevelopment' book and am having major probs with my first mysql database.

i save the code as .php:

<?
$connect = mysql_connect("localhost", "root", "mypassword") or
die(mysql_error());

mysql_create_db("wiley")
or die (mysql_error());

mysql_select_db ("wiley");

etc

...but when i run the prog in my browser, with apache running, i get the following error message (line six being the first line proper in the code:


Warning: mysql_connect(): Lost connection to MySQL server during query in C:\Program Files\Apache Group\Apache2\test\createmovie.php on line 6

Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files\Apache Group\Apache2\test\createmovie.php on line 6


bearing in mind that apache and php are all working fine and i know the password and localhost paths are correct - please could someone help me figure ot whats going on!

Thanks a million
 
Old February 6th, 2005, 07:05 PM
Authorized User
 
Join Date: Dec 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to colin.horne
Default

Please can you paste line 6, to check that you are querying the database properly.

You should never ever ever try to connect to MySQL as root from a script (unless you absolutely have to - for example, to add new SQL users).

Check MySQL is running, etc etc. Try opening a shell to MySQL, and check that you can query the database okay from there.

Cheers

--
Please contact me at:
Colin (dot) Horne (at) gmail (dot) com
My blog: http://colinhorne.blogspot.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Events are not firing msrnivas .NET Web Services 14 April 21st, 2008 06:37 AM
Events not firing in IE malk ASP.NET 1.0 and 1.1 Professional 7 August 29th, 2006 01:32 PM
Firing Blanks... ozPATT Access VBA 11 January 20th, 2006 11:26 AM
Class_Terminate not firing ddebreceni Beginning VB 6 4 July 14th, 2003 11:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.