安裝MySQL數據庫
如果你下載的是源碼,按如下方式安裝
# pw groupadd MySQL
# pw useradd mysql -g MySQL -s /nonexitent
# tar -zxvf MySQL-3.23.53.tar.gz
# mv mysql-3.23.53 MySQL
# cd 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 &
# echo "/usr/local/mysql/bin/safe_mysqld --user=MySQL &" > /etc/rc.local
# ./MySQLadmin -u root -p password "your-passWord"
已編譯包安裝方法如下:
shell> cd /usr/local
shell> gunzip < /path/to/MySQL-VERSION-OS.tar.gz | tar xvf -
shell> ln -s mysql-VERSION-OS MySQL
shell> cd MySQL
shell> scripts/MySQL_install_db
shell> chown -R root /usr/local/MySQL
shell> chown -R mysql /usr/local/MySQL/data
shell> chgrp -R mysql /usr/local/MySQL
shell> chown -R root /usr/local/MySQL/bin
shell> bin/safe_mysqld --user=MySQL &
# echo "/usr/local/mysql/bin/safe_mysqld --user=MySQL &" >> /etc/rc.local
還是注意MySQL的權限比較好
如果MySQLd不能執行的話
# chmod 755 /usr/local/mysql/libexec/MySQLd