Results 1 to 6 of 6

Thread: mysql db_create error metasploit

  1. #1
    Very good friend of the forum hhmatt's Avatar
    Join Date
    Jan 2010
    Posts
    660

    Default mysql db_create error metasploit

    Here's my exact error:

    Code:
    root@bt:/pentest/exploits/framework3# ./msfconsole
    
    (I removed the fancy metaploit text for this post)
    
           =[ msf v3.3-dev
    + -- --=[ 345 exploits - 223 payloads
    + -- --=[ 20 encoders - 7 nops
           =[ 123 aux
    
    msf > load db_mysql
    [*] Successfully loaded plugin: db_mysql
    
    msf > db_create
    
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user 'root'@'localhost' (using password: NO)'
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)[*] Database creation complete (check for errors)
    
    msf > db_import_nmap_xml xpsp2.xml
    [-] Error while running command db_import_nmap_xml: Access denied for user 'root'@'localhost' (using password: NO)
    I've tried this with a regular user also and I get an access denied error message.

    I was trying to get metasploit running on ubuntu 8.0 and was having some of the same difficulties. I did have metasploit working properly earlier, but only after running:

    Code:
    dpkg-reconfigure mysql-server-5.0
    Is there a better fix to this error rather than reconfiguring mysql everytime?

  2. #2
    Senior Member secure_it's Avatar
    Join Date
    Feb 2010
    Location
    在這兩者之間 BackTrack是4 FwdTrack4
    Posts
    854

    Default

    Manually go to /var/lib & delete mysql folder
    next use dpkg-reconfigure mysql-server-5.0
    Don't assign any password just hit enter otherwise it create a lot of trouble when metasploit communicate with mysql.

    now u can use
    msf > load db_mysql[*] Successfully loaded plugin: db_mysql
    msf > db_create[*] Database creation complete (check for errors)[*] Database creation complete (check for errors)

  3. #3
    Very good friend of the forum hhmatt's Avatar
    Join Date
    Jan 2010
    Posts
    660

    Default

    Its on a HD install and everytime I reboot or try to create a new mysql server using msfconsole I have to manually delete /var/lib/mysql folder then reconfigure mysql.

    Update: I can now get everything working properly in msfconsole if i start a mysql daemon using this command:

    Code:
    mysqld --skip-grant-tables
    Then set the terminal aside until your done but I know there has to be more to this problem.

  4. #4
    Senior Member secure_it's Avatar
    Join Date
    Feb 2010
    Location
    在這兩者之間 BackTrack是4 FwdTrack4
    Posts
    854

    Default

    Quote Originally Posted by hhmatt81 View Post
    Its on a HD install and everytime I reboot or try to create a new mysql server using msfconsole I have to manually delete /var/lib/mysql folder then reconfigure mysql.

    Update: I can now get everything working properly in msfconsole if i start a mysql daemon using this command:

    Code:
    mysqld --skip-grant-tables
    Then set the terminal aside until your done but I know there has to be more to this problem.
    No that is wrong thing you are using & in actual you are telling mysql to skip the permission tables.this is not normal behaviour.after using the commands what I told to you,the mysql service will start with booting.you can see that in startup as starting mysql daemon.for confirming use netstat -ant to check its listening on port 3306.as the side note if its not listening then use
    service mysql start
    I am using same thing without any problem.I came across these things while playing with Snort+Mysql

    In between what is the meaning of creating a new mysql server.actually you are creating database not the server.

  5. #5
    Very good friend of the forum hhmatt's Avatar
    Join Date
    Jan 2010
    Posts
    660

    Default

    Thanks! I didn't delete the mysql folder prior to reconfiguring. Seems to work pretty well now.

  6. #6
    Senior Member secure_it's Avatar
    Join Date
    Feb 2010
    Location
    在這兩者之間 BackTrack是4 FwdTrack4
    Posts
    854

    Default

    This mysql error FIX has been addressed by me in thread here.
    http://forums.remote-exploit.org/showthread.php?t=20586

Posting Permissions

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