SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member kuznles's Avatar
    Join Date
    Aug 2006
    Location
    Somerville, TN USA
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySql/PHP kevins new book problem

    I have installed MySql, Apache and PHP, on my windows XP computer with 1gig mem., all installations worked the way the book said until I got to the point of creating a new DB called jokes, the message came back access denied. I tried several times but it just would not work, so I created a DB called test (which I had earlier dropped) and it worked, so I built the Jokes DB in it and all is fine. I tried to create a couple of other databases but none will work other than that everything seems to work. How do you create a database in php?

  2. #2
    SitePoint Member
    Join Date
    Feb 2009
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I believe the database gets created with the mysql.
    The php uses mysql to access what you store in the database, or it could be used to create or delete databases or tables.
    There can be multiple tables in the same database.
    The book has a table for authors, categories and jokes. They all exist in the jokes database.
    I really struggled building databases/tables at first. I had an easier time doing it on my webhost than on my local machine.
    I hope that helps, and
    You guru's out there correct me if I am mistaken please!

  3. #3
    SitePoint Member kuznles's Avatar
    Join Date
    Aug 2006
    Location
    Somerville, TN USA
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Upon going back, it was in the first part of the MySql that I ran into the problem, but then I created the test database and put all the joke stuff in it and then went on to the php intro.
    I still have not figured out how to make a data base in Mysql and something I read said not to use test for my work as it is used for other stuff. I guess I am just stuck until some one tells me what could be wrong. I went back through the books instructions and everything appears to be right except that I cannot create a data base other than test.
    Last edited by kuznles; Jul 15, 2009 at 16:26. Reason: typo

  4. #4
    SitePoint Member kuznles's Avatar
    Join Date
    Aug 2006
    Location
    Somerville, TN USA
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    The message I get when I try to create a database is:
    mysql>create database mary;
    error 1044 (4200): access denied for user ' ' @' localhost' to database mary

    it doesn't matter what name I use, other than test, it rejects them all.

  5. #5
    SitePoint Member
    Join Date
    Feb 2009
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you working on your own computer trying to set it up or on a server like godaddy?

  6. #6
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    maybe try resetting the 'root' user password. This is by default the account used to create databases. I hope this helps.

  7. #7
    SitePoint Member kuznles's Avatar
    Join Date
    Aug 2006
    Location
    Somerville, TN USA
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am working on my own computer and I will try to reset the root password, thanks.

  8. #8
    SitePoint Member kuznles's Avatar
    Join Date
    Aug 2006
    Location
    Somerville, TN USA
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have tried several times to reset the root password and I can't do it. I even removed mysql and re installed it and it still did the same thing. if I type:
    "mysqladmin -u root -p password" it comes back with password and if I hit enter, I get the error message. If I type:"mysqladmin -u mary43 -p pasword"
    it comes back with "password" I hit enter and it says "to few arguments to change password.
    If I use "mary43" as the password everything works except I still can't make a database.
    I have now found that I am not connecting to the localhost. When I input the status query, I get connect to server at localhost failed. when I put in the telnet ?, I get could not open connection to host, on port 3306
    Last edited by kuznles; Jul 19, 2009 at 06:56.


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
  •