MySQL Help, Was working now it isnt [urgent work based site]

Problems with the Windows version of XAMPP, questions, comments, and anything related.

MySQL Help, Was working now it isnt [urgent work based site]

Postby tehwabbit » 21. December 2007 20:23

ive beendeveloping my new site all day now and xampp was working fine! then after a restart due to a locked up program XAMPP will now load.. and loads SQL fine.. (status: activated) but whenever i run a SQL script on my pages SQL disconnects (status: deactivated) briefly and doesnt allow me to connect to any SQL (including phpMyAdmin!)

ANy ideas?
ive done a fresh reinstall to, have no other SQL servers operating since my reboot and didnt change a single thing from default settings:

Errors:
On the php page as it executes:
Code: Select all
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10048) in C:\xampp\htdocs\test\config.php on line 31


in PhpMyAdmin AFTER the pag is executed:
Code: Select all
 MySQL said: Documentation
#2003 - The server is not responding


on the php page AFTER executing and phpmyAdmin has fecked up
Code: Select all
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10048) in C:\xampp\htdocs\test\inc\main.php on line 3


ALSO: phpmyadmin says:
Your PHP MySQL library version 5.0.45 differs from your MySQL server version 3.23.32. This may cause unpredictable behavior.

Any help appreaciated as this project is vital and at the second i have to result to using InstantServers Miniportal :S :(



EDIT: i checked the connection against the code by doing this;
Code: Select all
<?PHP
echo 'Connecting to Database...  ';
$link = mysql_connect($dbHost,$dbUser,$dbPass);
if (!$link) {
   die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
?>
which just returned Could not connect: Can't connect to MySQL server on 'localhost' (10048)
tehwabbit
 
Posts: 2
Joined: 21. December 2007 20:18

Postby Izzy » 22. December 2007 04:14

It looks to me like the MySQL associated with your MiniPortal may be loading as a service and interfering with the XAMPP implementation when you boot your PC.

The clue is in the 2 very different MySQL versions when using phpMyAdmin.

Visit your MiniPortal configurations and try and remove the services from being started when you boot your machine.

It is advisable to try and keep these 2 servers (XAMPP and MiniPortal) as separate as possible so none of the server's implementations try and run at the same time as they will always be in conflict and give you a headache.

You can always check to see if the ports XAMPP requires exclusively are being used by other implementations or are free, by running:
xampp\xampp-portcheck.exe

To get rid of the MySQL service running at present try this:
Stop all Apache, MySQL instances if they are running.

Close/Exit the XAMPP control panel.

Open a command console
Click start
Click on Run...
Type: cmd.exe

Type at the command prompt in the console:
sc delete mysql
Hit Enter on your keyboard

After reading the returned message close the command console.

Start the XAMPP control panel and try start Apache and MySQL again or use the provided bat files so that any errors on starting may be revealed.

BTW - sc is an acceptable abbreviation for sc.exe Windows Service Controller and will delete any stray services that won't shut down by any normal means, among other services commands.

Microsoft explains the Service Controller Commands here.


===========================================
1. The new DeskTopXampp Launch Control for XAMPP / XAMPPlite
Posted by Ridgewood available from Ridgewood'sDTX web site

2. Build Rich AJAX Applications - Faster
TIBCO General Interface Pro Edition but FREE and Open Source
Fully working with NO donations required to get a user/password
===========================================
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby tehwabbit » 22. December 2007 12:58

mmm, now im confused... i installed MiniPortal after xammp. Now when i restart my PC miniportal loads up apache straight away (so i removed this option)
Now if i do Portcheck i get all ports free and status empty aswell:

i then open Xammp and Run Apache (do a quick port-check and all is fine) and then do the same for SQL - its definately loading off Xammp directory and no other SQL process' are running on the system at the second.

I then try to run my index.php page and the same error is returned :S Maybe its something to do with my code? I only think this as phpMyAdmin works fine and i can do as i please with SQL commands etc within this.

My code im using where the first error crashing the DB is:

Code: Select all
//SQL Connection start!
mysql_connect($dbHost,$dbUser,$dbPass);
@mysql_select_db($dbName) or die( "Unable to select database");
$result = mysql_query("SELECT * FROM news ORDER BY id desc");
$num = mysql_num_rows($result);
mysql_close();
//SQL table connection success. continue with varaibles and such.

$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
$au_id=mysql_result($result,$i,"au_id");
$title=mysql_result($result,$i,"Title");
$date=mysql_result($result,$i,"date");
$category=mysql_result($result,$i,"Category");
$content=mysql_result($result,$i,"content");
$auid2name = auid2name($au_id);
}
$i++;
?>


Where the dbName etc are coming from config.php defined before.

I jsut cant work it out, im quite good with computers normally and have never had a problem like this :(

Thanks for the help though so far :)
tehwabbit
 
Posts: 2
Joined: 21. December 2007 20:18


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 55 guests