>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名称>