Author Topic: problem mysql  (Read 19075 times)

hussinv12

  • Newbie
  • *
  • Posts: 17
    • View Profile
on: July 13, 2013, 11:10:04 AM

hello ...



h313
@h313:~$ mysql -u root -p
Enter password

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passwordYES)



The problem appear even during install phpmyadminHe thinks when entering phpmyadmin panel
Tired and I'm looking for a solution




ZEROF

  • Hero Member
  • *****
  • Posts: 1247
    • View Profile
    • Pen Tester
Reply #1 on: July 13, 2013, 11:50:47 AM
Hi,

I already answered to your question:

http://forum.backbox.org/software-support/phpmyadmin/msg2453/#msg2453

Maybe you will need to remove older installation :

apt-get purge mysql-server phpmyadmin
« Last Edit: July 13, 2013, 12:02:32 PM by ZEROF »


Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*


hussinv12

  • Newbie
  • *
  • Posts: 17
    • View Profile
Reply #2 on: July 13, 2013, 01:56:03 PM



 :'( :'( :'( :'(



hussinv12

  • Newbie
  • *
  • Posts: 17
    • View Profile
Reply #3 on: July 13, 2013, 02:14:50 PM
i did  not forget password

When Enter the sudo-i is converted to the root  ,and without problems


problem  mysql



ZEROF

  • Hero Member
  • *****
  • Posts: 1247
    • View Profile
    • Pen Tester
Reply #4 on: July 13, 2013, 02:29:47 PM
I tested right now, it's all about passwords you need to set. I will make you tut tonight when i back home if you don't find solutions.


Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*


hussinv12

  • Newbie
  • *
  • Posts: 17
    • View Profile
Reply #5 on: July 13, 2013, 05:44:07 PM
okay

When I worked rebooting the system and layer it
h313@h313:~$ sudo mysql -u root -p
 Enter password:
 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)


؟؟؟؟؟
« Last Edit: July 13, 2013, 06:04:24 PM by hussinv12 »



ZEROF

  • Hero Member
  • *****
  • Posts: 1247
    • View Profile
    • Pen Tester
Reply #6 on: July 13, 2013, 06:41:29 PM
You don't have password for root user.

sudo -i

passwd

And for mysql

mysqladmin -u root password your pass

If you want to change (or update) a root password

mysqladmin -u root -p'oldpass' password newpass

;)
« Last Edit: July 13, 2013, 08:00:26 PM by ZEROF »


Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*


hussinv12

  • Newbie
  • *
  • Posts: 17
    • View Profile
Reply #7 on: July 13, 2013, 11:23:33 PM
# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)



ZEROF

  • Hero Member
  • *****
  • Posts: 1247
    • View Profile
    • Pen Tester
Reply #8 on: July 14, 2013, 12:24:14 AM
Ok, show me what you get with :

cd /var/run/

find my*


If you don't find :

mysqld
mysqld/mysqld.pid
mysqld/mysqld.sock


Then do next :

mkdir /var/run/mysqld
cd /var/run/mysqld
touch mysqld.sock
sudo chown -R mysql:mysql /var/run/mysqld/


Then:

sudo service mysql restart

Then login :

mysql -u root -p
« Last Edit: July 14, 2013, 12:55:10 AM by ZEROF »


Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*


hussinv12

  • Newbie
  • *
  • Posts: 17
    • View Profile
Reply #9 on: July 15, 2013, 12:23:35 PM
Code: [Select]
root@h313:/var/run# mkdir /var/run/mysqld
root@h313:/var/run# cd /var/run/mysqld
root@h313:/var/run/mysqld# touch mysqld.sock
root@h313:/var/run/mysqld# sudo chown -R mysql:mysql /var/run/mysqld/
root@h313:/var/run/mysqld# sudo service mysql restart
stop: Unknown instance:
start: Job failed to start
root@h313:/var/run/mysqld# sudo service mysql restart
stop: Unknown instance:
start: Job failed to start
root@h313:/var/run/mysqld# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (1



ZEROF

  • Hero Member
  • *****
  • Posts: 1247
    • View Profile
    • Pen Tester
Reply #10 on: July 16, 2013, 01:58:38 AM
Hm,

If next steps don't help you, i don't see what can help you :).

sudo apt-get update && sudo apt-get upgrade

Then watch this small video :

http://ascii.io/a/4195

When you are done run:

mysql_secure_installation

This command will help you to clean few stuff and set security.


Don't ask, read : http://wiki.backbox.org
or just run sudo rm -rf /*


SaThaRiel

  • Guest
Reply #11 on: July 16, 2013, 01:41:42 PM
Code: [Select]
root@h313:/var/run# mkdir /var/run/mysqld
root@h313:/var/run# cd /var/run/mysqld
root@h313:/var/run/mysqld# touch mysqld.sock
root@h313:/var/run/mysqld# sudo chown -R mysql:mysql /var/run/mysqld/
root@h313:/var/run/mysqld# sudo service mysql restart
stop: Unknown instance:
start: Job failed to start
root@h313:/var/run/mysqld# sudo service mysql restart
stop: Unknown instance:
start: Job failed to start
root@h313:/var/run/mysqld# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (1
Actually this all looks like you don't have mysql-server installed....what does
Code: [Select]
dpkg -l 'mysql*'bring up?



ostendali

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 587
    • View Profile
Reply #12 on: July 18, 2013, 08:02:05 AM
You don't have password for root user.

sudo -i

passwd

And for mysql

mysqladmin -u root password your pass

If you want to change (or update) a root password

mysqladmin -u root -p'oldpass' password newpass

;)
indeed, follow the above instructions given by zerof, they are the only way to reset mysql root password. also make sure that mysql is installed in your system and if it is running.

Try to perform the zerof instructions also after shutting down the mysqld if the 1st case doesn't work.

this information can be easily found on mysql official web site.



hussinv12

  • Newbie
  • *
  • Posts: 17
    • View Profile
Reply #13 on: July 20, 2013, 01:23:06 PM
Code: [Select]
root@h313:/var/run# mkdir /var/run/mysqld
root@h313:/var/run# cd /var/run/mysqld
root@h313:/var/run/mysqld# touch mysqld.sock
root@h313:/var/run/mysqld# sudo chown -R mysql:mysql /var/run/mysqld/
root@h313:/var/run/mysqld# sudo service mysql restart
stop: Unknown instance:
start: Job failed to start
root@h313:/var/run/mysqld# sudo service mysql restart
stop: Unknown instance:
start: Job failed to start
root@h313:/var/run/mysqld# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (1
Actually this all looks like you don't have mysql-server installed....what does
Code: [Select]
dpkg -l 'mysql*'bring up?



h313@h313:~$ dpkg -l 'mysql*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  mysql-client   5.5.31-0ubuntu MySQL database client (metapackage depending
un  mysql-client-4 <none>         (no description available)
un  mysql-client-5 <none>         (no description available)
un  mysql-client-5 <none>         (no description available)
ii  mysql-client-5 5.5.31-0ubuntu MySQL database client binaries
un  mysql-client-c <none>         (no description available)
ii  mysql-client-c 5.5.31-0ubuntu MySQL database core client binaries
ii  mysql-common   5.5.31-0ubuntu MySQL database common files, e.g. /etc/mysql
un  mysql-common-4 <none>         (no description available)
un  mysql-server   <none>         (no description available)
un  mysql-server-4 <none>         (no description available)
un  mysql-server-5 <none>         (no description available)
un  mysql-server-5 <none>         (no description available)
ii  mysql-server-5 5.5.31-0ubuntu MySQL database server binaries and system da
un  mysql-server-c <none>         (no description available)
un  mysql-server-c <none>         (no description available)
un  mysql-server-c <none>         (no description available)
ii  mysql-server-c 5.5.31-0ubuntu MySQL database server binaries



hussinv12

  • Newbie
  • *
  • Posts: 17
    • View Profile
Reply #14 on: July 20, 2013, 01:24:43 PM
Hm,

If next steps don't help you, i don't see what can help you :).

sudo apt-get update && sudo apt-get upgrade

Then watch this small video :

http://ascii.io/a/4195

When you are done run:

mysql_secure_installation

This command will help you to clean few stuff and set security.
Thank you but not solved the problem appears to me like the image above error