安装脚本如下
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DSYSCONFDIR=/etc/mysql -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DENABLED_LOCAL_INFILE=1 make make install cp ./support-files/my-default.cnf /etc/mysql/my.cnf groupadd mysql useradd -g mysql mysql -s /usr/sbin/nologin #不是登陆用户 chown -R mysql:mysql /usr/local/mysql
启动
./mysqld --defaults-file=/etc/mysql/my.cnf --user=mysql
可以正常成功
但是用
./mysqld_safe --defaults-file=/etc/mysql/my.cnf --user=mysql
会启动两个mysql
root 4933 18865 0 15:01 pts/1 00:00:00 /bin/sh ./mysqld_safe --defaults-file=/etc/mysql/my.cnf --user=mysql mysql 5023 4933 7 15:01 pts/1 00:00:00 /usr/local/mysql/bin/mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/localhost.localdomain.err --pid-file=/usr/local/mysql/data/localhost.localdomain.pid
配置mysql.server 也会启动两个mysql,目前依旧没解决原因。。。