SunQuest
 
           MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old February 8th, 2004, 10:53 AM
BrencelJ BrencelJ is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 6 BrencelJ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question MySQL Problems

Can you help me with this errors:


Warning: mysql_connect(): Unknown MySQL Server Host 'root@localhost' (11001) in G:\htdocs\Game Page\mysql\povezava.php on line 2

Warning: Missing argument 2 for send_sql() in G:\htdocs\Game Page\mysql\funkcije.php on line 2
Unknown database 'ime_podatkovne_zbirke'

This are the programs:


PHP Code:
<?php
function send_sql($db,$sql)
{
if (! 
$res=mysql_db_query($db,$sql))
{
echo 
mysql_error();
exit;
}
return 
$res;
}
?>




PHP Code:
<?php
$link
=mysql_connect("root@localhost","admin","zelva");
$db="ime_podatkovne_zbirke";
?>




PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<
html>
<
head>
<
title>Untitled Document</title>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</
head>
<
body>
<?
php
include ("funkcije.php");
include (
"povezava.php");
$sql="...SQL-ukazi...";
If (
$res=send_sql($db)){
echo 
"SQL-ukaz je bil izveden";
}
?>
</body>
</html> 

Reply With Quote
  #2  
Old February 9th, 2004, 06:53 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Your server name needs to be just "localhost" rather than "root@localhost."
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #3  
Old February 9th, 2004, 08:48 AM
BrencelJ BrencelJ is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 6 BrencelJ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Now the error is like this

Quote:
Warning: mysql_connect(): Access denied for user: 'admin@localhost' (Using password: YES) in G:\htdocs\Game Page\mysql\povezava.php on line 2

Warning: Missing argument 2 for send_sql() in G:\htdocs\Game Page\mysql\funkcije.php on line 2
Unknown database 'ime_podatkovne_zbirke'

Reply With Quote
  #4  
Old February 9th, 2004, 10:20 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Ok, so now you need to make sure that user is a valid user and has access to the database in question. Go to mysql.com and look up the syntax for "GRANT." You can also manually update the row for the given user in the mysql user database/table and flush privileges to force the changes.

Reply With Quote
  #5  
Old February 9th, 2004, 11:42 AM
BrencelJ BrencelJ is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 6 BrencelJ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Could you be more specific becaus I'm new with this operation pleas.

Could you tell me what do I do with GRANT I foun it in mysql.com and is just a program what can I do with it or coud you tell me more specific how can I do this
Quote:
You can also manually update the row for the given user in the mysql user database/table and flush privileges to force the changes.

Reply With Quote
  #6  
Old February 9th, 2004, 11:57 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Actually, it's not a program but a command. You need to log into your mysql server as the root user (or a user with grant privileges) and issue the grant command at the prompt. I presume you had to have either command line access or some other way of creating your database initially. Whatever utility you used should also allow you to modify privileges, either manually using the grant command or updating the user table. I don't think I can boil it down beyond that.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > MySQL Problems


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway