1. 程式人生 > >Xampp使用mysql命令提示Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

Xampp使用mysql命令提示Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

[email protected]:~$ mysql -h localhost -u root -p
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
[email protected]:~$ 

<pre name="code" class="html">以上命令的路徑預設為linux系統附帶的mysql路徑,故出現以上問題( '/var/run/mysqld/mysqld.sock'實際上是系統附帶的mysql套接字埠的路徑)



[email protected]:~$ /opt/lampp/bin/mysql -h localhost -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.20 Source distribution

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 


相關推薦

no