MySQL啟動的問題 - Linux

Table of Contents


看著鳥哥的網站
剛剛想說架設Apache + MySQL + PHP

目前
Apache + PHP
算是完成了

現在剩下MySQL
鳥哥版的是這樣

[root@linux ~]# /etc/init.d/mysqld start
# 如果是初次使用這個指令來啟動,你的 /var/lib/mysql 會建立資料庫。

[root@linux ~]# netstat -tuln | grep ':3306'
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN

# 底下在測試看能否以手動的方式連上 MySQL 資料庫!
[root@linux ~]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 4.1.20

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> quit
Bye


但我的版本是這樣

[root@localhost ~]# /etc/init.d/mysql start
bash: /etc/init.d/mysql: 沒有此一檔案或目錄
[root@localhost ~]# netstat -tuln | grep ':3306'
[root@localhost ~]# mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var
/lib/mysql/mysql.sock' (2)
[root@localhost ~]# quit
bash: quit: command not found

首先我說一下
/var/lib/mysql 這個目錄,裡面其實沒有任何資料的啦
是我要在那目錄裡面擺資料嗎
還是說一點關係都沒有

--

All Comments

Kristin avatarKristin2010-07-13
應該要用/etc/init.d/mysqld start,你的mysqld沒起來啊
Rachel avatarRachel2010-07-14
..是你打錯還是你PO上來PO錯了? /mysql"d"
Sarah avatarSarah2010-07-16
哈哈~~~~打錯~~~謝謝