Results 1 to 2 of 2

Thread: Mysql is killing me

  1. #1
    Just burned his ISO
    Join Date
    Jan 2010
    Posts
    3

    Default Mysql is killing me

    Dear All,

    when i try to configure snort from k menu-> services-> set & initialize snort everything is fine there when i go to web browser hxxp://localhost/base after first screen i choose mysql as database type, snort as database name, localhost as database host, root as database name and password which i configure earlier but when i submit this message comes

    Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /usr/share/php/adodb/drivers/adodb-mysql.inc.php on line 364
    Database connection failed!
    Please try again!

    when i try to connect with mysql using mysql -u root -p this error message comes
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
    I search Google to resolve this but enable to find the solution i tried every method to connect with mysql with user root but failed to do so its only connect with user mysql but i can't use any database or create new one using user mysql

  2. #2
    Junior Member
    Join Date
    Aug 2007
    Posts
    40

    Default

    I would guess it's an issue with one of your *.conf files. Maybe your snort.conf or base_conf.php, both of which have entries for your database password.

    Also, I'm not sure the information you provided is 100% accurate.

    when i try to connect with mysql using mysql -u root -p this error message comes
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
    If you use the -p option to provide a password then you should not see "(using passowrd: NO)". Here is an example...

    root@bt:~# mysql -u root
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) (<--No -p option and not prompted for password)
    root@bt:~# mysql -u root -p (<-- Used -p option and prompted for password)
    Enter password:
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) (<-- Different error message.)
    If for some reason you typo'd the root password for MySQL when you were setting it up and your not sure what it is now then you can modify it by using the -skip-grant-tables parameter in the MySQL startup script, or even when manually starting the MySQL server like this...

    root@bt:/usr/bin# cd /etc/init.d
    root@bt:/etc/init.d# mysqld_safe --skip-grant-tables &
    [1] 6175
    root@bt:/etc/init.d# nohup: ignoring input and redirecting stderr to stdout
    Starting mysqld daemon with databases from /var/lib/mysql
    mysqld_safe[6214]: started

    root@bt:/etc/init.d# mysql -u root
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 1
    Server version: 5.0.67-0ubuntu6 (Ubuntu)

    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

    mysql> use mysql;
    mysql> update user set password=PASSWORD("sqljockey") where User='root';
    mysql> flush privileges;
    mysql> quit
    root@bt:/etc/init.d# /etc/init.d/mysql stop
    * Stopping MySQL database server mysqld STOPPING server [ OK ]
    [1]+ Done mysqld_safe --skip-grant-tables
    root@bt:/etc/init.d# /etc/init.d/mysql start
    * Starting MySQL database server mysqld [ OK ]
    root@bt:/etc/init.d# mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 25
    Server version: 5.0.67-0ubuntu6 (Ubuntu)

    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

    mysql> exit


    Hope this helps a little, if not maybe you could provide more details by checking log files, etc. Good luck.

Posting Permissions

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