Dark57 Posted March 31, 2010 Share Posted March 31, 2010 I seem to be doing something wrong, but I'm brand new to MySql and I have no clue as to why this is happening. I tried to troubleshoot it a few ways, opened up the .ini and looked through that but I'm not sure as to why I'm still getting this error. I am running Vista and using WAMPserver for my development. Is there something I am missing from either not running it on a real server or am I forgetting to add something? I am getting this error: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'SYSTEM'@'localhost' (using password: NO) in C:\wamp\www\Chapter 4 - Databasing\databaseconnect.php on line 5 could not connect: Access denied for user 'SYSTEM'@'localhost' (using password: NO) This is my code: <html> <body> <?php $con = mysql_connect(); if(!$con) { die('could not connect: ' . mysql_error()); } ?> </body> </html> Link to comment https://forums.phpfreaks.com/topic/197138-basic-mysql-question/ Share on other sites More sharing options...
Jax2 Posted March 31, 2010 Share Posted March 31, 2010 $host=""; // your host (I.e. localhost) $username=""; // your username $password=""; // your password dbname="";// database name $con= mysql_connect($host, $username, $password); mysql_select_db($dbname,$db); Link to comment https://forums.phpfreaks.com/topic/197138-basic-mysql-question/#findComment-1034806 Share on other sites More sharing options...
Dark57 Posted March 31, 2010 Author Share Posted March 31, 2010 By default the $con = mysql_connect(); will set itself as Localhost,system,no password so I don't think that is the problem. I'm only trying to connect to MySql right now as part of this tutorial so would I really have to select a database? Link to comment https://forums.phpfreaks.com/topic/197138-basic-mysql-question/#findComment-1034810 Share on other sites More sharing options...
Dark57 Posted March 31, 2010 Author Share Posted March 31, 2010 Yeah even using your method its denying me, is there a place to set a user/password to the MySql and what is the default MySql user/password? Link to comment https://forums.phpfreaks.com/topic/197138-basic-mysql-question/#findComment-1034813 Share on other sites More sharing options...
Jax2 Posted March 31, 2010 Share Posted March 31, 2010 Found a link that discusses setting up user passwords and such when installing wamp server ... to be done in mysql: see if you can find what you need here: http://www.puremango.co.uk/2009/01/wamp_97/ Link to comment https://forums.phpfreaks.com/topic/197138-basic-mysql-question/#findComment-1034817 Share on other sites More sharing options...
Dark57 Posted March 31, 2010 Author Share Posted March 31, 2010 Ok, I'm not sure how to set users using WAMP and all but by setting the default password I can use the "root" user and it works now. Thanks for finding that. Link to comment https://forums.phpfreaks.com/topic/197138-basic-mysql-question/#findComment-1034926 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.