473,586 Members | 2,702 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem mysql_connect with php

1 New Member
sir
i wrote the code to connect php with mysql
but it create error
CODE
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $con = @mysql_pconnection("localhost","utsavi",****);
  3. if ($con)
  4. echo("connect");
  5. }
  6. ?>
ERROR
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localho st' (using password: YES) in E:\vnr\utsavi1\ xampp\htdocs\cn c.php on line 6
Error connecting to mysql

PLEASE
send me right information & code
Mar 24 '10 #1
1 1560
Dormilich
8,658 Recognized Expert Moderator Expert
mysql_pconnecti on() is no native PHP function (that would be mysql_pconnect( )), however, you connect through mysql_connect() , reason for that: your function fails, but by calling mysql_select_db (), it tries to open a connection with mysql_connect() using the default values.

you manage to log in as "root", not as "utsavi". obviously the two passwords don’t match.

no neet to use @ to suppress errors (that usually backfires to you in some way)
Mar 24 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
3860
by: das dsf | last post by:
Hi there! I have both PHP 4.0( RPM) installed and MySQL 4.0.20 installed with the mysqld daemon up and running. But when I look at the output of phpinfo() , I do not see it there, which is worrisome and so I tried to recompile PHP and do ./configure with the --with-mysql=path but I don't really know where my mysql's header files should be ,...
12
3275
by: Gustaf Liljegren | last post by:
I've been learning using PHP and MySQL from the tutorial at freewebmasterhelp.com. Everything works fine, except deleting things. The script is invoked with a URL like this: http://www.example.org/test/delete_entry.php?id=35 And here's the script: <? include("dbinfo.inc.php");
1
1364
by: Bob Garbados | last post by:
I have the following sitution... MySQL version 3.23.47 PHP version 4.3.2 Redhat Linux version 7.1 Apache version 1.3.29 I have a MySQL user called 'user' that is set up with full rights for localhost, 127.0.0.1, and the external IP address.
2
2829
by: Sugapablo | last post by:
I have a small test script connecting to a MySQL database. It seems to work, unless I try to use the resource link identifier returned by mysql_connect(); This works and returns all the rows in the table: <?php include("../config.php"); $dbi = mysql_connect($dbhost,$dbuname,$dbpass);
19
8098
by: Michael | last post by:
Hi, I'm trying to do something which should be very simple - connect to the MySQL database. Here is the call, followed by the error msg. $conn = mysql_connect("localhost", "root", ""); Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /var/www/html/buildhw.php on line 13
6
3263
by: TonyB | last post by:
I'm running the zip'd version of PHP (PHP 5.1.2 zip package) downloaded from here: http://www.php.net/downloads.php. PHP won't connect with MySQL. >From docs and threads, it seems enabling PHP/MySQL connectivity on a Windows XP machine requires three configuration edits. These are: 1. In php.ini, enable php_mysql.dll by uncommenting...
8
1492
by: dude | last post by:
this is the code: $user = "user"; $pass = ""; $connect = mysql_connect('localhost',$user,$pass); or die('could not connect: '. mysql_error()); mysql_close($connect); i'm a beginer, and i just want to see if i could connect to server.
6
3355
by: GD | last post by:
Hi All, I've got MySQL 5.0.21 running on Windows Server 2003, and php running on Apache on a Linux box (Fedora Core 4). Previously when the pages were running on an IIS server the connection was succesful, now I get: Can't connect to MySQL server on 'SERVER' (13)
1
1914
by: goodmann | last post by:
Paris, Le 30 08 MMVII, Hi, I have a problem using to connect to MYSQL from one server to another server. In other words, On server A, I have my PHP files, and on server B, I have MySQL installed.
10
1669
by: paul814 | last post by:
I am having a bit of a problem with some code....can someone give me some suggestions? Parse error: syntax error, unexpected '{' in C:\xampp\htdocs\production \date2.php on line 28 line 28 is this line: while($row = mysql_fetch_array(mysql_query($sql)) { It is the first while..
0
7911
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8215
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3836
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1448
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1179
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.