>configure --prefix=/myhome/mysql --exec-prefix=/myhome/mysql --with-charset=gb2312
>make
>make install
編輯/etc/my.cnf
[mysqld]
datadir=/myhome/mysql/data
socket=/tmp/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
[mysql.server]
user=slview
basedir=/myhome/mysql
[mysqld_safe]
err-log=/myhome/mysql/log/mysqld.log
pid-file=/myhome/mysql/run/mysqld/mysqld.pid
lower_case_table_names=1
socket=/tmp/mysql.sock
log檔案
>mkdir -p /myhome/mysql/run/mysqld
>mkdir -p /myhome/mysql/data
>mkdir -p /myhome/mysql/log
#初始化資料庫
>/myhome/mysql/bin/mysql_install_db --user=<username>
啟動mysql
用slview帳號:
./mysqld_safe --defaults-file=/etc/my.cnf --user=<username> &
設定根的口令
/myhome/mysql/bin/mysqladmin -u root password 'root321'
停mysql服務
./mysqladmin -u root -p shutdown
遠程登入維護:
./mysql -h <ip> -u root -D dbnms -p
常用維護命令:
show databases;
show tables;
use <database名稱>