SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: Error problems

  1. #1
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error problems

    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.

    CREATE TABLE `databasename`.`users` (`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

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,895
    Mentioned
    211 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    Try the following command, just to make sure that you really do have the correct privileges:
    Code MySQL:
    GRANT ALL on databasename.* to 'marcus'@'localhost' identified by 'password';

    Then try re-running the command.
    Does that work?

  3. #3
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  4. #4
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,895
    Mentioned
    211 Post(s)
    Tagged
    12 Thread(s)
    Hi there,
    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?

  5. #5
    SitePoint Zealot
    Join Date
    Jul 2012
    Location
    Scarborough, North Yorkshire, United Kingdom
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi

    Pullo is on the right track but I think you need to use 'Me' instead of 'Marcus'

    Code:
    GRANT ALL PRIVILEGES ON `databasename`.* TO 'me'@'localhost'
    Can I also confirm that you changed databasename to the correct value too?
    Richard
    Resell SSL Certificates - API / WHMCS / HostBill / ClientExec
    ServerTastic - RapidSSL, Geotrust, Thawte, Symantec, SmarterTools and more

  6. #6
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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!

  7. #7
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,895
    Mentioned
    211 Post(s)
    Tagged
    12 Thread(s)
    Hi there,

    Quote Originally Posted by flashnewbe View Post
    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.

    Good luck!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •