Solved

Error connecting to mysql on localhost

Posted on 2016-10-06
3
73 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 52

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

626 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