Solved

Error connecting to mysql on localhost

Posted on 2016-10-06
3
44 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Creating and Managing Databases with phpMyAdmin in cPanel.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

708 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

16 Experts available now in Live!

Get 1:1 Help Now