LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   mysql problem (https://www.linuxquestions.org/questions/linux-software-2/mysql-problem-4175589273/)

BAKABON 09-12-2016 11:03 AM

mysql problem
 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2 "No such file or directory")
i get this error when i run the command : "mysql -u root -p"
i m currently using manjaro linux.

HMW 09-12-2016 11:07 AM

What does:
Code:

netstat -ln | grep mysqld
Say?

BAKABON 09-12-2016 11:29 AM

nothing
 
the command was just executed successfully without an error but didnt give me any output.

HMW 09-12-2016 11:46 AM

Quote:

Originally Posted by BAKABON (Post 5604171)
the command was just executed successfully without an error but didnt give me any output.

Well, that most likely means that you do not have a mysql server up and running, since it is not listening on any port.

How did you start your mysql server, if at all?

Also, what does:
Code:

ps aux | grep mysql
say?

BAKABON 09-12-2016 12:37 PM

[bakabon@bakabon-Xenon mysql]$ ps aux | grep mysql
root 3758 0.0 0.1 70072 4864 pts/0 T 22:54 0:00 sudo mysqld_safe
root 3759 0.0 0.0 13888 3252 pts/0 T 22:54 0:00 /bin/sh /usr/bin/mysqld_safe
mysql 3873 0.1 3.0 656468 121084 pts/0 Sl 22:54 0:00 /usr/bin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/bakabon-Xenon.err --pid-file=bakabon-Xenon.pid --socket=/run/mysqld/mysqld.sock --port=3306
bakabon 4000 0.0 0.2 43024 9360 pts/0 S+ 22:56 0:00 mysql
bakabon 4023 0.0 0.0 10764 2104 pts/1 S+ 22:58 0:00 grep --colour=auto mysql

keefaz 09-12-2016 01:43 PM

Do you have a /run directory in your system?
Look like a setup error to me (should be /var/run)

HMW 09-12-2016 01:55 PM

Quote:

Originally Posted by keefaz (Post 5604222)
Do you have a /run directory in your system?
Look like a setup error to me (should be /var/run)


/run
is simply a symlink to /var/run (at least on arch linux) so it shouldn't really matter.

Best regards,
HMW

keefaz 09-12-2016 02:00 PM

Quote:

Originally Posted by HMW (Post 5604226)

/run
is simply a symlink to /var/run (at least on arch linux) so it shouldn't really matter.

Best regards,
HMW

Ah thanks !

To Op: Did you check /run/mysqld content and permissions?

BAKABON 09-13-2016 01:25 AM

how do i do it?

keefaz 09-13-2016 04:51 AM

Kali Linux is your installed OS?

I ask because I heard there are no other user than root in setup, and mysql requires 'mysql' user and group

Anyway, you can check permissions and content with the ls command
Code:

ls -l /run/mysqld


All times are GMT -5. The time now is 08:32 PM.