Results 1 to 7 of 7

Thread: MySQL database creation error

  1. #1
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935

    MySQL database creation error

    I installed MySQL server 4.0.13 on my Debian "testing" box ( stable seems too old for me ).

    When I tried to create the database, it spits out this error message.
    Code:
    DebServer:/home/compunuts# mysqladmin create pndb -p
    Enter password:
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user: 'root@localhost' (Using password: YES)'
    DebServer:/home/compunuts# exit
    exit
    compunuts@DebServer:~$ mysqladmin create pndb -p
    Enter password:
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user: 'compunuts@localhost' (Using password: YES)'
    So what seems to be the problem and how do I fix it? Or point me to something to read?

    TIA

  2. #2

    Re:MySQL database creation error

    Did you already set some users? You might give the '-u root' a shot in your command.

    Here's a simple way to set users:

    mysqladmin -u username password 'password'
    mysqladmin -u username -h hostname password 'password'

    Now set the perms for that user:

    mysql -u username -p -e "GRANT INSERT,SELECT on databasedbfile.* to username@hostname"
    mysql -u username -p -e "GRANT INSERT,SELECT on databasedbfile.* to username@localhost"

    You can log into mysql as 'root' and use the command SELECT * FROM user; to view user on the database. (Make sure you change DBs first with \u database )

    Hope that helps some.

  3. #3
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935

    Re:MySQL database creation error

    Ah, solved the problem but I will leave this post for those who had problems later on.

    Logged into the mysql database with
    Code:
    mysql -u root -p
    and then enter "password" as your password.

    Then change the password using,
    Code:
    mysql> use mysql; 
    mysql> UPDATE user SET Password=PASSWORD('mynewpassword') WHERE User='root'; 
    mysql> FLUSH PRIVILEGES;
    in 'mynewpassword', substitute whatever you like ( but keep the single quote as it's.

    HTH for those folks who might encounter the problem later on.

  4. #4
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935

    Re:MySQL database creation error

    How do we add uses to existing database?

    For example, if I want user "compunuts" to use the database "pnvs" instead of user "root", how?

    TIA

  5. #5

    Re:MySQL database creation error

    The GRANT command is what you are looking for. Click here for all of the options with the GRANT command

  6. #6

    Re:MySQL database creation error

    Switch databases with the /u command, and then use:

    GRANT INSERT, SELECT on database.* to user@hostname;

  7. #7
    Moderator
    Good Guru
    Compunuts's Avatar
    Join Date
    May 2001
    Location
    California
    Posts
    3,935

    Re:MySQL database creation error

    Got it, thanks guys ....

Similar Threads

  1. Visio's Database Links
    By The Donald in forum Windows - General Topics
    Replies: 0
    Last Post: 01-05-2005, 06:32 AM
  2. New Features that are included in Access 2000
    By regix in forum Windows - General Topics
    Replies: 0
    Last Post: 01-01-2005, 02:17 AM
  3. GL not working ati 7000
    By Mip in forum Linux - Software, Applications & Programming
    Replies: 19
    Last Post: 10-28-2004, 09:29 PM
  4. Questions,sound, aureal, using MDK 9.0
    By SuperRobotic in forum Linux - General Topics
    Replies: 12
    Last Post: 02-10-2003, 01:31 PM
  5. Tid-Bits #6- GRUB error code
    By babbing in forum Linux - General Topics
    Replies: 2
    Last Post: 09-10-2002, 08:44 AM

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
  •