编译的时候制定路径:
./configure '--prefix=/usr/local/mysql2' '--localstatedir=/data/dbdata3/' '--with-unix-socket-path=/usr/local/mysql2/tmp/mysql.sock' '--with-charset=utf8' '--with-extra-charsets=armscii8,ascii,big5,cp1250,cp1251,cp1256,cp1257,cp850,cp852,cp866,cp932,dec8,eucjpms,euckr,gb2312,gbk,geostd8,greek,hebrew,hp8,keybcs2,koi8r,koi8u,latin1,latin2,latin5,latin7,macce,macroman,sjis,swe7,tis620,ucs2,ujis,utf8' '--with-pthread' '--enable-thread-safe-client' '--with-ssl' '--with-plugins=partition,federated,ndbcluster,innobase,csv,blackhole,myisam,innodb_plugin,heap,archive' '--enable-shared' '--enable-assembler'
安装初始化数据库的时候要指定my.cnf的位置
/usr/local/mysql2/bin/mysql_install_db --user=mysql --defaults-file=/data/dbdata3/my.cnf
记得对/data/dbdata3/my.cnf更改数据文件的存放路径,以及目录端口等等
启动mysql的时候也要指定my.cnf
/usr/local/mysql2/bin/mysqld_safe --defaults-file=/data/dbdata3/my.cnf --user=mysql &
阅读(4962) | 评论(0) | 转发(1) |