11sven Posted August 9, 2009 Share Posted August 9, 2009 i recently upgraded to wamp5 four of my databases work but the first one doesn't it gives me this error Access denied for user 'SYSTEM'@'localhost' (using password: NO) i've tried everything including trying to export the database into a new one with another name. another person said i had a password problem. so i tried old passwords. i am at a loss. Quote Link to comment https://forums.phpfreaks.com/topic/169419-solved-access-denied-for-user-systemlocalhost-using-password-no/ Share on other sites More sharing options...
PFMaBiSmAd Posted August 9, 2009 Share Posted August 9, 2009 Post your code from the start of the file up though and including the line where that error is being generated. Post any files being included in that portion of the code as well. Show the opening php tags that are in the file(s). xxxxxx out any sensitive information but don't change any of the syntax in the file(s). Quote Link to comment https://forums.phpfreaks.com/topic/169419-solved-access-denied-for-user-systemlocalhost-using-password-no/#findComment-893867 Share on other sites More sharing options...
11sven Posted August 9, 2009 Author Share Posted August 9, 2009 this is my main index page the error shows up at line 24 <?php include("poet_layout.php"); $page_title = "Drunken Irish Poet, Home Page"; ?> <div id="content"> <p>You don't have to be drunk or Irish to be a poet, but it helps. This site contains poetry that reflects my life experience. You can <a href="index2.php">submit your poems</a> and be included in the poetry database. You can submit poems on any subject, in any style. </p> <p> Check out the new features on this site. Now you can <a href="join2.php">register</a> and submit your poem directly to the site. You can also post comments to others poems. Registration is free and easy(about 30 seconds) and your email will never be used for evil purposes. <span style="color:#ccff33;"><b>NEW</b> Search this site, just enter term into search box. </span> You can browse poems without signing up but if you want to post a poem or comment you must be logged in. </p> <p> All poems posted on this site are the property of the posting author and may not be reproduced without the express permission of the author. </p> <h1>Poet of the Month-<?php echo date('F'); ?></h1> <?php $sql = mysql_query("SELECT *, date_format(poem_date, '%M %D, %Y') as poem_date FROM poem WHERE poem_id = 1"); !!!ERROR SHOWS UP HERE!!! $row= mysql_fetch_array($sql); stripslashes(extract($row)); $cat_name = mysql_result(mysql_query("SELECT cat_name FROM poem_categories WHERE cat_id = '$cat_id'"),0); $cat_name = nl2br(stripslashes(htmlentities($cat_name))); $username= nl2br(stripslashes(htmlentities($username))); $poem_title= nl2br(stripslashes(htmlentities($poem_title))); $poem_body = nl2br(stripslashes(htmlentities($poem_body))); ?> this is poet_layout <?php include("conn/session.php"); include("conn/dbcon.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title><?php if(isset($page_title)){echo $page_title;}?></title> <link href="css/poetblue.css" rel="stylesheet" type="text/css"/> <meta name="keywords" content="poet, poem, poems, poetry, submit poems, irish poet, drunken irish poet"/> <meta name="description" content="gallery of original poetry. writers are invited to submit poems and be poet of the month"/> </head> <body> <img src="image/logocap.gif" alt="logo" width="70" height="70" id="left"/> <div class= "logo"><img src="image/poetlogo3.gif" width="600" height="70" alt="Drunken Irish Poet"/></div> <div id="links"> <p> <a href="index.php">Home</a> <a href="project/poet1.html">Gallery 1</a> <a href="project/poet2.html">Gallery 2</a> <a href="submit.php">Submit Poem</a> <a href="index2.php">View Poems</a> <a href="project/links.html">Links</a> </p> <p class="searchbox"> <?php include("boxes/member_box.php"); include("html/search_form.php"); ?> </p> </div> this is my connection page <? //$sql=mysql_connect('MySQLHost', '***', '***); $sql=mysql_connect('localhost', 'drunkard', '******'); mysql_select_db('d60010322', $sql) or die(mysql_error()); ?> Quote Link to comment https://forums.phpfreaks.com/topic/169419-solved-access-denied-for-user-systemlocalhost-using-password-no/#findComment-893873 Share on other sites More sharing options...
PFMaBiSmAd Posted August 9, 2009 Share Posted August 9, 2009 <? //$sql=mysql_connect('MySQLHost', '****', '***d'); $sql=mysql_connect('localhost', 'drunkard', '******'); mysql_select_db('d60010322', $sql) or die(mysql_error()); ?> Don't use short open tags <? and <?=. They are not portable between server configurations and sooner or later you will end up on a server where they are not turned on and you won't have the ability to turn them on. Quote Link to comment https://forums.phpfreaks.com/topic/169419-solved-access-denied-for-user-systemlocalhost-using-password-no/#findComment-893875 Share on other sites More sharing options...
11sven Posted August 9, 2009 Author Share Posted August 9, 2009 so that's <?php for the open and ?> for the close right? Quote Link to comment https://forums.phpfreaks.com/topic/169419-solved-access-denied-for-user-systemlocalhost-using-password-no/#findComment-893877 Share on other sites More sharing options...
11sven Posted August 9, 2009 Author Share Posted August 9, 2009 i changed the opening php tag and this is what i got. Warning: mysql_connect() [function.mysql-connect]: OK packet 6 bytes shorter than expected in C:\wamp\www\drunken\conn\dbcon.php on line 4 Warning: mysql_connect() [function.mysql-connect]: mysqlnd cannot connect to MySQL 4.1+ using old authentication in C:\wamp\www\drunken\conn\dbcon.php on line 4 Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in C:\wamp\www\drunken\conn\dbcon.php on line 5 mysqlnd cannot connect to MySQL 4.1+ using old authentication Quote Link to comment https://forums.phpfreaks.com/topic/169419-solved-access-denied-for-user-systemlocalhost-using-password-no/#findComment-893887 Share on other sites More sharing options...
fenway Posted August 10, 2009 Share Posted August 10, 2009 Then you need a new version of the mysql libraries. Quote Link to comment https://forums.phpfreaks.com/topic/169419-solved-access-denied-for-user-systemlocalhost-using-password-no/#findComment-894775 Share on other sites More sharing options...
11sven Posted August 11, 2009 Author Share Posted August 11, 2009 i just made a new user and password for the database and it works fine now. Quote Link to comment https://forums.phpfreaks.com/topic/169419-solved-access-denied-for-user-systemlocalhost-using-password-no/#findComment-895715 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.