Help - Search - Members - Calendar
Full Version: Easy Question About Mysql
Zymic Webmaster Forums > Zymic Free Web Hosting > Databases & MySQL
philippeb
Hi there, i was gonna setup a php-fusion site.
But then i was gonna make the DB as asked for, and now..
Well, lets just say i cant login ^^
I cant really understand. what do i have to type as login username for php-myadmin ?
And where can i find the "Host path" for my setup ?

I know this is a really FAQ and i should search the forum, the only problem is that i suck at english and will have to get my friend translate all the time, so a direct answer will be mucht more helpful smile.gif

THanks
Dave
Take a look at this.
sariemaniez
hi..

i have problems to connecting to database
each time i try to connect to database (try this 'http://pengumuman.vndv.com/scripts/conf.php') i always get this message :

-------------
Warning: mysql_query() [function.mysql-query]: Access denied for user 'vhostswww'@'localhost' (using password: NO) in /www/vndv.com/p/e/n/pengumuman/htdocs/scripts/conf.php on line 14

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /www/vndv.com/p/e/n/pengumuman/htdocs/scripts/conf.php on line 14
Access denied for user 'vhostswww'@'localhost' (using password: NO)
--------------

this is the script on conf.php page ;

--------------
<?php
$db_host = 'localhost';
$db_user = 'pengumuman_mainuser';
$db_pass = '****';
$db_name = 'pengumuman_maindb';

function opendb() {
global $db_host, $db_user,

$db_pass, $db_name, $db_connect;
$db_connect=@mysql_connect($ini,

$db_user, $db_pass);
$db_select=@mysql_select_db

($db_name);
}
function querydb($query) {
if(!empty($query)) {
$result = mysql_query

($query) or die(mysql_error());
return $result;
} return true;
}
function closedb() {
global $db_connect;
mysql_close($db_connect);
}
opendb();
$rArrIPA=querydb('SELECT id, nama_ipa FROM pelajaran_ipa ORDER BY id');
closedb();
?>
------------------------

i already made pengumuman_mainuser user and pengumuman_maindb database, and i already connected the user and database, and i already give all privilages to pengumuman_mainuser user. i never made vhostswww user.

how to solve this probelms ?

i have no problems at all on my other account

thanks, and sorry for my bad english

Jacob - Do not post your passwords in your files. Replace your password with ****.
Jacob
Your DB User is more then 16 characters. It needs to be less then 16.

Jacob.
danzrev
QUOTE(NaRzY @ Jul 31 2008, 07:26 AM) *
Your DB User is more then 16 characters. It needs to be less then 16.

Jacob.



Hello there,


Yes it should be less than 16 so if your username is already more than 10, So you no have 6 characters to added as mysql username and mysql database. So to safe you can just add atleast 3 character.



danzrev
sariemaniez
QUOTE(NaRzY @ Jul 31 2008, 07:26 AM) *
Your DB User is more then 16 characters. It needs to be less then 16.

Jacob.


wow thanks, it works tongue.gif

but, why i didn't have this problems in 99k.org ?
i have sweetme_99k_org_useraja user in 99k.org, it's more than 16 chars, but there's no problem with it ?
Jacob
In the 99k.org servers, I think it was 53. (Was for zxq.net anyways.)

Jacob.
sariemaniez
QUOTE(danzrev @ Jul 31 2008, 08:18 AM) *
Hello there,
Yes it should be less than 16 so if your username is already more than 10, So you no have 6 characters to added as mysql username and mysql database. So to safe you can just add atleast 3 character.
danzrev


thanks tongue.gif
miswu13
hi. Sorry to bother, but i have the same problem, i have changed the name of my database and user to student-radio_r , it has 15 characters, but still nothing. i get the following error :

QUOTE
Warning: mysql_query() [function.mysql-query]: Access denied for user 'vhostswww'@'localhost' (using password: NO) in /www/vndv.com/s/t/u/student-radio/htdocs/usersonline.php on line 18

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /www/vndv.com/s/t/u/student-radio/htdocs/usersonline.php on line 18

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /www/vndv.com/s/t/u/student-radio/htdocs/usersonline.php on line 19

Warning: mysql_query() [function.mysql-query]: Access denied for user 'vhostswww'@'localhost' (using password: NO) in /www/vndv.com/s/t/u/student-radio/htdocs/usersonline.php on line 22

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /www/vndv.com/s/t/u/student-radio/htdocs/usersonline.php on line 22

Warning: mysql_query() [function.mysql-query]: Access denied for user 'vhostswww'@'localhost' (using password: NO) in /www/vndv.com/s/t/u/student-radio/htdocs/usersonline.php on line 32

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /www/vndv.com/s/t/u/student-radio/htdocs/usersonline.php on line 32
Access denied for user 'vhostswww'@'localhost' (using password: NO)


The php file code is
CODE
<?

//REMEMBER TO CONNECT TO THE DATABASE!!

$ip =            $_SERVER['REMOTE_ADDR'];
$time =             time();

$ip_check = 'SELECT ip FROM `users_online` WHERE ip = \''.$_SERVER['REMOTE_ADDR'].'\'';
$ip_query = mysql_query($ip_check);
$num_rows = mysql_num_rows($ip_query);

if(!$num_rows) { //if no rows, meaning no ip's in db matched theirs, we will add them.
   $insert_new = mysql_query("INSERT INTO `users_online` (ip, time) VALUES ('$ip', '$time')");  
} //end if NOT THERE

//this means that they're already in there, so we update info.
   if($num_rows > 0) {
      $update = mysql_query('UPDATE `users_online` SET time=\''.time().'\' WHERE ip = \''.$_SERVER['REMOTE_ADDR'].'\'');
       if(!$update) die(mysql_error());
} // end UPDATE

//if time now - start time > 300 then its been 5 minutes, so we delete
   $delete_old = mysql_query("DELETE FROM `users_online` WHERE ((".time()."-time) > 300)");
     if(!$delete_old) die(mysql_error());

//show the number of people online now....
$id_query = @mysql_query("SELECT * FROM `users_online`");
$users_online = mysql_num_rows($id_query);

echo("<BR>The number of people here are : $users_online<BR>");
//users online is done....
?>


It isn't the only application that it is not working, and i have the same error message at anyone of them :|

Thanks
Ed
QUOTE(miswu13 @ Aug 10 2008, 01:45 PM) *
//REMEMBER TO CONNECT TO THE DATABASE!!


Perhaps you didn't see that ;-)

http://www.php.net/mysql-connect
http://www.php.net/mysql-select-db
miswu13
QUOTE


Wow. it realy works. smile.gif thank you. It took me 20 min to understand what it says, but now it's working smile.gif

Thank you verry much smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.