小弟初學乍到 Linux
我照各個論壇文章大大步驟去架設但到了password時就卡關
這邊我是靠著VMware架設的,並且透過Xshell去進行遠端登入root狀態
版本Centos7(原因我看文章大大適用這版本 就學用這版本)
小弟想學習 如何架設 Mantis 但是在mariadb這關就卡關了
下面是問題
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Enter current password for root (enter for none):
Aborting!
正常來說第一次架設 應該密碼按Enter就會跳過 但是他一直出現
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
網路上查詢文章 貌似是找不到socket '/var/lib/mysql/mysql.sock 這關係
請大大幫幫我解答 卡關兩天找不到!
第一次在這PO問題 假設 排版不對或太亂請告知我 我下次會改進 謝謝。
*
因新手訓練期間 我無法回復各位 所以我在這做回覆抱歉...
回casper2048 : mariadb 有重新安裝過了
回tomatoeggs : 我用您介紹的網站後,我發現mysql上未啟動,謝謝~但我目前也不知道我該如何啟動 ORZ..
回bizpro : 謝謝您,確實是未啟動,但我操作您下列的方式時 它顯示
[root@localhost ~]# /etc/my.cnf
-bash: /etc/my.cnf: 拒絕不符權限的操作
[root@localhost ~]# /var/lib/mysql/mysql.sock
-bash: /var/lib/mysql/mysql.sock: 沒有此一檔案或目錄
(稍早我發現未啟動時 已嘗試 如何便有權限 但我已經root 我還需要特別去做什麼動作嗎? )
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
表示
你確定 mariadb-server 有啟動吧 ?
用下面指令在 root 的 console ... 可看到是否啟動
systemctl status mariadb
還是 看看有沒有在程序裡面
ps -ef |grep mariadb
如果有啟動那可找找看 mysql.sock 在哪
find / -name mysql.sock
有那就改路徑 .... 編輯 /etc/my.cnf 找到 socket
socket = /var/lib/mysql/mysql.sock
簡單的 mariadb-server 安裝是 ....
yum update
yum install mariadb-server
systemctl enable mariadb
systemctl start mariadb
systemctl status mariadb