MySQL Connect Error

  • neksus
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Sep 10, 2004
  • Posts: 2206
  • Loc: Canada
  • Status: Offline

Post April 4th, 2008, 3:24 pm

A permissionless user can not log into a database if they haven't been assigned to the database, can they?
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post April 4th, 2008, 3:24 pm

  • joebert
  • Weathered
  • Genius
  • User avatar
  • Joined: Feb 10, 2004
  • Posts: 11872
  • Loc: Clearwater, FL
  • Status: Offline

Post April 4th, 2008, 3:27 pm

But what about the syntax error ?
Why yes, yes I am.
  • cjxxi
  • Expert
  • Expert
  • No Avatar
  • Joined: Aug 02, 2004
  • Posts: 548
  • Loc: Fort Worth, TX
  • Status: Offline

Post April 4th, 2008, 4:37 pm

neksus wrote:
A permissionless user can not log into a database if they haven't been assigned to the database, can they?



Code: [ Download ] [ Select ]
$answer = ($MAYBE)? YES:NO;

http://www.google.com/search?hl=en&q=pe ... tnG=Search
networklatino.com
-----------------------------------
  • Bogey
  • Disturbed
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 7127
  • Loc: Ozzuland
  • Status: Offline

Post April 4th, 2008, 8:32 pm

GOD! :lol: I'll find out and give a definite answer to this...

ok... I added a user with 0 permission without assigning a database for it. It came with the following error...
Quote:
Access denied for user 'bogey'@'localhost' (using password: YES)

So yea... :lol: I was wrong but it is good to learn :)

Check your permissions AND check your passwords and check if you need to set one up for the user.
Learn PHP | I got 10 PHP tutorials! Check them out!
Dreamtale - Farewell
Just a note... I've giving up on web development and that stuff... Just lost all interest in it.
  • neksus
  • Mastermind
  • Mastermind
  • User avatar
  • Joined: Sep 10, 2004
  • Posts: 2206
  • Loc: Canada
  • Status: Offline

Post April 4th, 2008, 8:38 pm

lol
Thanks for clearing up cjxxi's smart ass remark :P
  • Bogey
  • Disturbed
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 7127
  • Loc: Ozzuland
  • Status: Offline

Post April 4th, 2008, 9:11 pm

:lol: No problem
Learn PHP | I got 10 PHP tutorials! Check them out!
Dreamtale - Farewell
Just a note... I've giving up on web development and that stuff... Just lost all interest in it.
  • cjxxi
  • Expert
  • Expert
  • No Avatar
  • Joined: Aug 02, 2004
  • Posts: 548
  • Loc: Fort Worth, TX
  • Status: Offline

Post April 4th, 2008, 9:43 pm

Quote:
Access denied for user 'bogey'@'localhost' (using password: YES)


and means your password is wrong
networklatino.com
-----------------------------------
  • cjxxi
  • Expert
  • Expert
  • No Avatar
  • Joined: Aug 02, 2004
  • Posts: 548
  • Loc: Fort Worth, TX
  • Status: Offline

Post April 4th, 2008, 9:45 pm

neksus wrote:
lol
Thanks for clearing up cjxxi's smart ass remark :P


Opps I apologyze i didn't mean to be smart ass, it just made more sence to do a search for that question
networklatino.com
-----------------------------------
  • Bogey
  • Disturbed
  • Genius
  • User avatar
  • Joined: Jul 14, 2005
  • Posts: 7127
  • Loc: Ozzuland
  • Status: Offline

Post April 4th, 2008, 9:51 pm

cjxxi wrote:
Quote:
Access denied for user 'bogey'@'localhost' (using password: YES)


and means your password is wrong

That could mean that yes, but I put in the password like the second after I made the permissionless user. I'm sure I put the password in correclty 100%
Learn PHP | I got 10 PHP tutorials! Check them out!
Dreamtale - Farewell
Just a note... I've giving up on web development and that stuff... Just lost all interest in it.
  • joebert
  • Weathered
  • Genius
  • User avatar
  • Joined: Feb 10, 2004
  • Posts: 11872
  • Loc: Clearwater, FL
  • Status: Offline

Post April 4th, 2008, 10:15 pm

Quote:
ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near '' at line

i had to enter the cmd env to test my query cos my php pages were just working like links. i know my php is ok cos i call pages with functions. i can select from my db tables but cant update or insert.


Where did you get the queries you tested via command line ?

That error looks to me like PHP is botching something before sending the query to the MySQL server.

What do you get if you echo/print the queries before calling mysql_query or equivalent ?

For instance,
Code: [ Download ] [ Select ]
$sql = $stuff . ' WHERE ' . $other_stuff;
echo $sql;
mysql_query($sql);
  1. $sql = $stuff . ' WHERE ' . $other_stuff;
  2. echo $sql;
  3. mysql_query($sql);
Why yes, yes I am.
  • yomi
  • Student
  • Student
  • User avatar
  • Joined: Apr 02, 2008
  • Posts: 92
  • Loc: Nigeria
  • Status: Offline

Post April 8th, 2008, 12:54 am

guys........

im using php with mysql, my connection seems fine cos i can connect to and select the database. my die error comes at the stage of inserting or updating my database. someone suggests i recheck mysql configuration. i dint do any configuration , just followed the wizard and i saw the black cmd screen, used and selected the db. i got a documentation on the config so let me just look thru it and get back to y'all.

Meanwhile, does anyone know why my GETHOSTBYNAME() would not work? i am using the server ip but cant capture the usernames on the network?

See y'all in a bit.
  • yomi
  • Student
  • Student
  • User avatar
  • Joined: Apr 02, 2008
  • Posts: 92
  • Loc: Nigeria
  • Status: Offline

Post April 8th, 2008, 1:07 am

sorry dint read the second page. erm..... joebert, i first of all copied out my code from my page, dint work then checked documentation and used the same syntax.
If i echo a string, it shows, if i echo the sql, it shows but i noticed that my values are not enclosed in 'quotes'. it just echoes them as csv.

brb!
  • yomi
  • Student
  • Student
  • User avatar
  • Joined: Apr 02, 2008
  • Posts: 92
  • Loc: Nigeria
  • Status: Offline

Post April 8th, 2008, 1:35 am

all parameters are correctly set.

guess i have to keep troubleshooting.
  • joebert
  • Weathered
  • Genius
  • User avatar
  • Joined: Feb 10, 2004
  • Posts: 11872
  • Loc: Clearwater, FL
  • Status: Offline

Post April 8th, 2008, 2:46 am

I'd like to see what you're using.
Why yes, yes I am.
  • yomi
  • Student
  • Student
  • User avatar
  • Joined: Apr 02, 2008
  • Posts: 92
  • Loc: Nigeria
  • Status: Offline

Post April 8th, 2008, 5:35 am

see what i'm using? as in mysql code?

$dbconx = mysql_connect('localhost','root','') or die('Error connecting to database');
mysql_select_db('cia_db',$dbconx) or die('Error selecting database');
$sql = "INSERT idea set agent='$user', presntn='$presntn', comment='$comment', detail='$detail',topic='$topic',outcome='$outcome' ";
//echo $sql;
mysql_query($sql,$dbconx) or die(' Error executing query');
mysql_close();
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post April 8th, 2008, 5:35 am

Post Information

  • Total Posts in this topic: 34 posts
  • Users browsing this forum: No registered users and 173 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© Unmelted Enterprises 1998-2009. Driven by phpBB © 2001-2009 phpBB Group.