problem mysql

Started by hussinv12, July 13, 2013, 12:10:04 PM

Previous topic - Next topic

hussinv12


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

#1
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

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

hussinv12


hussinv12

i did  not forget password

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


problem  mysql

ZEROF

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

#5
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)


؟؟؟؟؟

ZEROF

#6
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

;)

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

hussinv12

# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

ZEROF

#8
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

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

hussinv12

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

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

Quote from: hussinv12 on July 15, 2013, 01:23:35 PM
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
dpkg -l 'mysql*'bring up?

ostendali

Quote from: ZEROF on July 13, 2013, 07: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

;)
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

Quote from: SaThaRiel on July 16, 2013, 02:41:42 PM
Quote from: hussinv12 on July 15, 2013, 01:23:35 PM
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
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

Quote from: ZEROF on July 16, 2013, 02: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.
Thank you but not solved the problem appears to me like the image above error