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. Automated MySQL Database backup Script-on timely basis
    By linuxdepro in forum Linux - General Topics
    Replies: 2
    Last Post: 10-28-2013, 09:22 AM
  2. need help configuring Openldap with mysql database
    By ryswick in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 12-08-2010, 09:15 PM
  3. MySQL database user creation help needed
    By Compunuts in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 05-24-2006, 06:48 AM
  4. moving database from its default directory where mysql puts on new databases
    By infinite_root in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 05-15-2004, 11:52 PM
  5. Iptables logging to MySql database
    By xkill in forum Linux - Software, Applications & Programming
    Replies: 1
    Last Post: 02-11-2002, 07:45 PM

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
  •