Starting mysqld daemon with databases from /usr/mysql/var
020620 14:51:32 mysqld ended
020612 11:38:56 mysqld started
020612 11:38:56 /usr/mysql/libexec/mysqld: Can't create/write to file '/usr/mysql/var/email.pid' (Errcode: 13)
020612 11:38:56 /usr/mysql/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
020612 11:38:56 /usr/mysql/libexec/mysqld: Error on delete of '/usr/mysql/var/email.pid' (Errcode: 13)
020612 11:38:56 mysqld ended
核心錯誤:Errcode 13 = Permission denied。無法建立 pid 檔案、無法讀取 host.frm,均為權限問題。
未建立 mysql 用戶與群組,或資料目錄權限未正確設定給 mysql 用戶。
./configure --prefix=/usr/local/mysql
make
make install
scripts/mysql_install_db
chown -R root /usr/local/mysql
chown -R mysql /usr/local/mysql/var
chgrp -R mysql /usr/local/mysql
cp support-files/my-medium.cnf /etc/my.cnf
/usr/local/mysql/bin/safe_mysqld --user=mysql &
chown -R mysql /usr/local/mysql/var 讓資料目錄屬於 mysql 用戶chgrp -R mysql /usr/local/mysql 整個安裝目錄群組設為 mysqlmy-medium.cnf 到 /etc/my.cnf--user=mysql