By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,044 Members | 1,155 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,044 IT Pros & Developers. It's quick & easy.

Insert fails on access that I know works...

P: n/a

Folks,

I use PHP to write my form data to MySQL.

I have a database with about ten tables. I'm trying to fill one table with
some dummy data (its a contact manager table holding names of people,
addresses and whatever but I'm createing random values for the moment). The
insert fails telling me that access is denied - however I use the exact same
username/password/database name/host name on the other tables, and the
insert and updates work just fine.

I know this sounds odd - but is there any other reason as to why I might get
the access denied message, other than what I assume should be just for an
invalid username/password?

The following is a customized output of my error:

Query failed
Error Number 1044
Message: Access denied for user: '@localhost' to database 'myDatabase'
Comments:INSERT INTO myDatabase.contactManager (title, firstname, initial,
lastname, position, publisherHash, salutation, company, county, teldd,
telfax, telddext, division, telsb, telsbext, telcell, telpager, telother,
address1, address2, city, postcode, country, email, website, type) VALUES
("Ms", "Morpheus", "W", "YlastnameVFRE", "Partner",
"d98fb3d2476eaa8da3957481e0946109", "Dear Morpheus", "KcompanyQSJV",
"BcountyLJSW", "251-823-1450", "251-479-4495", "35", "Vancouver",
"251-682-5043", "883", "604-587-3284", "423-435-8301", "423-734-9771",
"Apartment 777 - 9431 North Way", "South Coquitlam", "Nanaimo", "Q22E14",
"CA", "bt*@gxyphn.net", "www.gxyphn.net", "1")

HOST= 192.168.1.2
USER= myUser
PASSWORD= myPassword
NAME= myDatabase
TABLE= contactManager

Can anyone suggest one area that I could look at to help fix the problem?
Pleaseeeeeee...

many thanks,
randelld
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Randell D. <yo**************************@yahoo.com> wrote:
I have a database with about ten tables. I'm trying to fill one table with
some dummy data (its a contact manager table holding names of people,
addresses and whatever but I'm createing random values for the moment). The
insert fails telling me that access is denied - however I use the exact same
username/password/database name/host name on the other tables, and the
insert and updates work just fine.
So you might have a permission problem, apparantly yhe user doens't have
insert priveliges...
I know this sounds odd - but is there any other reason as to why I might get
the access denied message, other than what I assume should be just for an
invalid username/password?


On the mysql site they have a whole page about this:
http://www.mysql.com/doc/en/Access_denied.html

--

Daniel Tryba

Jul 17 '05 #2

P: n/a

"Daniel Tryba" <ne****************@canopus.nl> wrote in message
news:bn**********@news.tue.nl...
Randell D. <yo**************************@yahoo.com> wrote:
I have a database with about ten tables. I'm trying to fill one table with some dummy data (its a contact manager table holding names of people,
addresses and whatever but I'm createing random values for the moment). The insert fails telling me that access is denied - however I use the exact same username/password/database name/host name on the other tables, and the
insert and updates work just fine.


So you might have a permission problem, apparantly yhe user doens't have
insert priveliges...
I know this sounds odd - but is there any other reason as to why I might get the access denied message, other than what I assume should be just for an invalid username/password?


On the mysql site they have a whole page about this:
http://www.mysql.com/doc/en/Access_denied.html

--

Daniel Tryba


Thanks for pointing me to the documentation - but it didn't help me (though
it might do in the future).

The user does have insert privilages - I had mentioned this earlier in my
post saying the same username and password worked for a different table in
the same database on the same server...

I think though I have solved it - Strangely, even though the message did
point to access being denied, I believe the problem related to a column in
the table that was suppoed to be unique, wasn't.

I have a unique hash created for each record - I discovered that even after
seeding a new random number sequence, the same md5 hash was created every
time... I've changed the code and unique hashes are created everytime now,
and the records seem to be writing just fine. So far, I've written four or
five thousand records...

Thanks for the prompt reply though...
Jul 17 '05 #3

P: n/a
Randell D. <yo**************************@yahoo.com> wrote:
On the mysql site they have a whole page about this:
http://www.mysql.com/doc/en/Access_denied.html
Thanks for pointing me to the documentation - but it didn't help me (though
it might do in the future).

The user does have insert privilages - I had mentioned this earlier in my
post saying the same username and password worked for a different table in
the same database on the same server...


Hmmmm, I forgot that access in mysql is per database and not per table
:)
I think though I have solved it - Strangely, even though the message did
point to access being denied, I believe the problem related to a column in
the table that was suppoed to be unique, wasn't.

I have a unique hash created for each record - I discovered that even after
seeding a new random number sequence, the same md5 hash was created every
time... I've changed the code and unique hashes are created everytime now,
and the records seem to be writing just fine. So far, I've written four or
five thousand records...


Funny, normaly a more approriate error would occur (at least that is my
experience).

--

Daniel Tryba

Jul 17 '05 #4

P: n/a

"Daniel Tryba" <ne****************@canopus.nl> wrote in message
news:bn**********@news.tue.nl...
Randell D. <yo**************************@yahoo.com> wrote:
On the mysql site they have a whole page about this:
http://www.mysql.com/doc/en/Access_denied.html


Thanks for pointing me to the documentation - but it didn't help me (though it might do in the future).

The user does have insert privilages - I had mentioned this earlier in my post saying the same username and password worked for a different table in the same database on the same server...


Hmmmm, I forgot that access in mysql is per database and not per table
:)
I think though I have solved it - Strangely, even though the message did
point to access being denied, I believe the problem related to a column in the table that was suppoed to be unique, wasn't.

I have a unique hash created for each record - I discovered that even after seeding a new random number sequence, the same md5 hash was created every time... I've changed the code and unique hashes are created everytime now, and the records seem to be writing just fine. So far, I've written four or five thousand records...


Funny, normaly a more approriate error would occur (at least that is my
experience).

--

Daniel Tryba


I would agree - I though would think its more likely I unknowingly fixed
more than one bug in my script than an error in MySQL...

Thanks for the help though...
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.