473,767 Members | 2,247 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Warning: mysql_connect() [function.mysql-connect]: Access denied for user

16 New Member
i got this error after uploading all the files in www folder. i'm using wamp.

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localho st' (using password: YES) in /home/.../public_html/....com/includes/connection.php on line 5
Database connection failed: Access denied for user 'root'@'localho st' (using password: YES)

how can i fix this? i'm really new to this.
Dec 19 '08 #1
2 27915
benicio
16 New Member
error_log

PHP Warning: mysql_connect() [<a href='function. mysql-connect'>functi on.mysql-connect</a>]: Access denied for user 'root'@'localho st' (using password: YES) in /home/.../public_html/....com/includes/connection.php on line 5
Dec 19 '08 #2
Atli
5,058 Recognized Expert Expert
Hi.

It's like the error message says. You are trying to connect to a MySQL database using invalid user information.

You should create a new user and give him access to the database you are going to be using.
Then you need to update your PHP code so that it uses the info for that user, rather then the old one.

Also, keep in mind that using the root user in a PHP script is a HUGE security risk. You should always create a limited user to use in your websites.

If you don't know how to do that, check out the GRANT statement in the MySQL manual.
Dec 20 '08 #3

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

Similar topics

3
49550
by: photoelectric | last post by:
When trying to run the below script on an apache/1.3.26 with mysql and php I get the following error message: Warning: mysql_connect() : Access denied for user: 'nobody@software-ece.rutgers.edu' (Using password: YES) in /ece/under/group14/public_html/insert.php on line 7 Unable to Select database I have no idea what the cause is, any help would be appreciated. Thanks in advance.
0
3395
by: Ryan Schefke | last post by:
------=_NextPart_000_0077_01C34C8B.2B90C960 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ..I just sent this out to the win32 distribution list but no one has replied.can someone on this list please help? The issue should be trivial for experienced MySQL users, I'm just a novice, thanks!
7
3300
by: George Hester | last post by:
Please take a look at this google artcle: http://groups.google.com/groups?hl=en&lr=&frame=right&th=55d6f4b50f5f9382&seekm=411f370d%241%40olaf.komtel.net#link9 The op was having trouble with access denied using resizeTo. I am having the same issue but the explanations in this article don't seem to apply here. I am not trying to resize a window with content from a different server. This issue lies here. What I do is make a popup...
14
2805
by: jolinlim | last post by:
Warning: mysql_connect(): Access denied for user: 'ODBC@localhost' (Using password: NO) in c:\appserv\www\sql.php on line 12 Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in c:\appserv\www\sql.php on line 13 Warning: mysql_query(): Access denied for user: 'ODBC@localhost' (Using password: NO) in c:\appserv\www\sql.php on line 14 Warning: mysql_query(): A link to the server could not be established in...
1
3143
by: servo | last post by:
I created a user "test1" (which then got the username "debscrof_test1" from CPanel), a password for the user "test2", and then added the user to a new database "testdb" with all priviliges Then a simple script to connect to the database (as I am trying to locate the source of the errors), as per below: <?php $dbhost = "localhost"; $dbuser = "debscrof_test1"; $dbpass = "test2"; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or...
0
1771
by: vozzek | last post by:
Hi all, I've got a mySQL database I've been working with as my localhost for several months now, no connection problems. I'm at the point however, where I need to connect to the database from another site / different IP address. I'm playing around in the PayPal sandbox, and I'm running an instant payment notification php script before the user exits. The included connection file looks like this: <?php $hostname_TFATP =...
2
3263
by: sbettadpur | last post by:
hello I am getting following error while connecting to mysql through php Warning: mysql_connect() : Access denied for user: 'pds@localhost' (Using password: YES) Actually I hosted one website on linux server, there i uploaded php script to the server, in that script i am trying to connect to the mysql, but i am getting above said problem i.e access denied for this user. I given all privileges to 'pds' user like "SELECT, INSERT...
5
9138
by: lisles | last post by:
i have a page funtion.php which hs the function to connect to the db /* Mysql Connection */ function connect(){ global $db_server,$db_user,$db_pass,$db;//Global Values from the config.php $conn = @mysql_connect($db_server,$db_user,$db_pass) or die("Connection to Database Server Failed"); @mysql_select_db($db) or die("Database Selection Failed"); return $conn; }
5
8898
by: Joel Phelan | last post by:
I am getting the below error when attempting to run a php script on my server which accesses a mysql table I have created in an existing database. I can connect to the database table via the MySQL workbench, but not via a php script I have written. This database was originally created for use with Magento Cart, which I have installed and which works correctly (can access it's database tables). I simply cannot access the database with a...
0
9404
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10009
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9838
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7381
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3929
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
3
2806
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.