[英]Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
I'm new to Ubuntu. 我是Ubuntu的新手。 I have xampp installed on Ubuntu and works just fine. 我在Ubuntu上安装了xampp并且运行正常。 But when I am trying to run mysql -u username -p pass
from terminal I recieve this error: 但是当我试图从终端运行mysql -u username -p pass
时我收到了这个错误:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'.
I've tried to install mysql-server
again but it runs completely separate (has another database....and is not working with phpmyadmin from xampp). 我曾尝试再次安装mysql-server
,但它完全独立运行(有另一个数据库......并且不能与xampp的phpmyadmin一起使用)。
How can I make it work in terminal from xampp server? 如何从xampp服务器在终端中使其工作?
Your mysql-database might not be running at all! 您的mysql数据库可能根本没有运行!
Try this: sudo /etc/init.d/mysql start then mysql -u yourusername -p yourpasswrd
试试这个: sudo /etc/init.d/mysql start then mysql -u yourusername -p yourpasswrd
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.