My problem started off with me not being able to log in as root any more on my mysql install. I was attempting to run mysql without passwords turned on... but whenever I
Why getting this error
I received new updates of mysql libraries so i updated my Kubuntu OS after that getting these errors.
Commands i tried and how i fixed it.
MySql-server is running correctly but when i tried to connect its giving
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'.
I checked /var/run/mysqld/mysqld.sock'.
this directory.
My files did not existed.
I also tried these commands to connect but did not worked for me.
mysql -h 127.0.0.1 -P 3306 -u root -p
sudo service mysql start
After wasting round about 2 hours i found the solution
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade -f
After that everything fixed for me.
This was mentioned a couple of times already, but this worked immediately for me:
service mysql restart
The solution is way easier.
mysql.sock
file is located. In my case it was in /opt/lampp/var/mysql/mysql.sock
sudo Nautilus
mysql.sock
file is located mysqld.sock
then Right click on the file and Cut it/var/run
and create a folder called mysqld
and enter itmysqld.sock
file at /var/run/mysqld/mysqld.sock
:)I faced same error and found that it was due to upgradation of packages, So after restarting my system I resolved error.
I think due to sql libraries/ packages update that error occured, So try this if you are doing some upgrading :)
solutions
finally uninstall and reinstall mysql. **
then install again by
After this operation, 164 MB of additional disk space will be used.
...... .......
At last you will get these lines....
Setting up libhtml-template-perl (2.95-1) ...
Setting up mysql-common-5.6 (5.6.16-1~exp1) ... Processing triggers for libc-bin (2.19-0ubuntu6) Processing triggers for ureadahead (0.100.0-16) ...
And then
root@ubuntu1404:~# mysql -u root -p (for every password first u should use )
Enter password:
Note :Entered password should be same as the installation time password of mysql(like .root,system,admin,rahul etc...)
Then type
USE rahul_db(database name);
Thanks.**
you can find mysqld.sock
in /var/run/mysqld
if you have already installed mysql-server
by sudo apt-get install mysql-server