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> 


相關推薦

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 c

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

1:下載 [[email protected] /]# tar -xzvf mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz -C /usr/local/ 1 3修改檔案 [[email protecte

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

在solaris 和 ubuntu下啟動Mysql, 都提示了這樣的錯誤 在網上搜索了許多解決方案之後,做如下總結: 1、mysql 沒有啟動,或者說是無法啟動,則之後執行Mysql的時候會提示這個錯誤。     而啟動mysql的時候在/etc/init.d目錄下啟動,有

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

問題描述 今天阿里雲伺服器安裝mysql的收,遇到了一個很熟悉的問題 輸入 #mysql -u root -p ERROR 2002 (HY000): Can't connect to local MySQL server through sock

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'的解決

# # The MySQL database server configuration file. # # You can copy this to one of: # - "/etc/mysql/my.cnf" to set global options, # - "~/.my.cnf" to set us

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

今天伺服器遇到了一個很熟悉的問題 輸入 #mysql -u root -p ERROR 2002 (HY000):Can't connect to local MySQL server 隨即上網找尋答案 根據大家提供的方法我逐一嘗試 方案1.  1.#ps -A|grep mysql   

用c語言連結MySQL資料庫出現Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

這個問題,困擾了我好幾天,最後終於解決了。首先,我用find命令找了半天,也只有/tmp/mysql.sock,當時我很崩潰啊,後來看到一篇文章,我忘了地址,讓我有感,於是解決了這個問題。 1、在/var/run/目錄下建立一個mysqld的資料夾(如果這個資

Ubuntu連線MySql報錯“can't connect to local mysql server through socket '/var/run/mysqld/mysqld.sock'”

在不重新安裝mysql的情況下,通過如下命令來解決,具體的就是先停止mysql服務,再重新開啟mysql服務 cd /etc/init.d sudo service mysql stop sudo service mysql start 

Mysql連線的過程中出現Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock

突然登入資料庫的時候,出現瞭如下錯誤:Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock 1.造成的可能原因   上午在網上查了一下關於Ubuntu下如何解決MySQ

連接Mysql提示Cant connect to local MySQL server through socket的解決方法

127.0.0.1 方式 mic div conn 三種 問題 ati my.cnf 轉:http://aiezu.com/article/mysql_cant_connect_through_socket.html 有時候,當我們使用“mysql”、“mysqladmin

連線Mysql提示Cant connect to local MySQL server through socket各種情況以及解決辦法(轉載)

轉自:http://www.aiezu.com/db/mysql_cant_connect_through_socket.html 產生此問題的原因一般有兩個: 1、mysql服務未正常執行: 由於mysql的socket檔案是由mysqld服務啟動時建立的,如果mysqld服務未正常啟動,soc

連接Mysql提示Cant connect to local MySQL server through socket各種情況以及解決辦法(轉載)

文件的 字符 -o exe localhost user body external The 轉自:http://www.aiezu.com/db/mysql_cant_connect_through_socket.html 產生此問題的原因一般有兩個: 1、mysql服務

連線Mysql提示Cant connect to local MySQL server through socket的解決方法

mysql,mysqldump,mysqldump,php連線mysql服務常會提示下面錯誤: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib

ERROR 2002 (HY000): Cant connect to local MySQL server through socket ‘/var mysql 啟動不了

nag could ice etc ket nbsp call cti connect ps -A | grep -i mysql kill 列出來的進程 service mysql start 我的問題就解決了 -----------------------------

Cant connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ 解決

bsp 文件讀取 my.cnf dir spa min pre 啟動 style mysql 改變 basedir 目錄,啟動後客戶端登陸出現 Can’t connect to local MySQL server through socket ‘/var/lib/mys

Cant connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ 解決

mysql 改變 basedir 目錄,啟動後客戶端登陸出現  Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’  問題,解決方式如下: /etc/my.cnf &nbs

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

先檢視 /etc/rc.d/init.d/mysqld status 看看m y s q l 是否已經啟動. 另外看看是不是許可權問題. ———————————————————————————— [[email protected] beinan]#chown -R mysql:mysql /var

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

如題所示,在Linux系統中啟動mysql報錯了: 能啟動mysql,但登入不了 網上存在各種各樣的方法和系統提示的最終還是沒有解決我的問題,因為在我的那個系統找不到所說的檔案 於是乎,乾脆殺掉程序試試: 然後重啟mysql 解決

Linux上mysql登陸錯誤解決辦法ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' 解決方法:1:首先確認你在root許可權下 [[email p

Can't connect to local MySQL server through socket '/var/lib/mysql'

在配置 sphinx報這個錯 ERROR: index 'test1': sql_connect: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) (D