Hello, I have only just started using mysql. I created a database and named it "databasename" and my username is "marcus". I have given my database all the privileges. I copy and pasted this code below into my database from a tutorial i read.
id INT(11) NOT NULL AUTO_INCREMENT,
username VARCHAR(300) NOT NULL,
password VARCHAR(300) NOT NULL, PRIMARY KEY (
id)) ENGINE = MyISAM;
When i pressed the go button this error popped up. #1142 - CREATE command denied to user 'me'@'localhost' for table 'users'
I know nothing about php so i am unable to figure out what the problem is. I really appreciate if someone can tell me what i have done wrong and how i can fix this. Thanks
Try the following command, just to make sure that you really do have the correct privileges:
GRANT ALL on databasename.* to 'marcus'@'localhost' identified by 'password';
Then try re-running the command.
Does that work?
Thank you Pullo for your reply. I did has you suggested unfortunately it didn't work. In the error it said "access denied" #1044
I on't understand why this happening. If you or anyone else has any more suggestions it be great to hear from you. Thanks
Since no one else replied to this thread, I'll have a go at helping you out.
Be warned however, it might be a case of the blind leading the blind so if anyone else has any suggestions, I'd be glad to hear them.
Anyway, let's take a step back.
Are you working on your local machine?
What is the OS?
How did you install MySQL?
Did you install only MySQL, or did you install one of the packages such as Xampp, Wamp, Lamp or Mamp?
Pullo is on the right track but I think you need to use 'Me' instead of 'Marcus'
GRANT ALL PRIVILEGES ON `databasename`.* TO 'me'@'localhost'
Can I also confirm that you changed databasename to the correct value too?
Thanks guys for your help. Sorry i took a long time to reply. Okey these are the details: I am using Windows 7. No mysql came free with my webhost. I did not need to install it. I did has you suggested Richard still receive that error. Database name i believe is correct. I can't figure it out at all lol.
I have only been using using mysql for about a week so im still learning the code and the meaning of the keywords. I think i will give up on this database and attempt a new one to see if i have any better luck!
Ok, there is always the chance there was a glitch in the Matrix and creating a new database will sort things out.
If the error persists, then let us know and we'll try to get to the bottom of it.
This topic is now closed. New replies are no longer allowed.