Solved

Error connecting to mysql on localhost

Posted on 2016-10-06
3
50 Views
Last Modified: 2016-10-06
Hello;

I have a connection to mysql via php code as below,and it was ok for years but today i get error connecting to database,what is the problem?

<?php
$connmag = mysql_pconnect($dbhostmag, $dbusermag, $dbpassmag) or die ('Error connecting to database,please refresh your page.');  
mysql_select_db($dbnamemag);                 
?>

Open in new window


I use win7+iis7.

thanks
0
Comment
Question by:MOSTAGHASSI
  • 2
3 Comments
 
LVL 49

Accepted Solution

by:
Ryan Chong earned 500 total points
ID: 41832079
make sure the MySQL service is running in your machine?
make sure the username and password provided are correct?
0
 

Author Comment

by:MOSTAGHASSI
ID: 41832095
mysql is not running it has error 2003.
0
 

Author Closing Comment

by:MOSTAGHASSI
ID: 41832122
I started mysql and it is ok, thanks.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now