安装目录需要设置到解压目录,否则报以下错误
[root@MySQL mysql-5.6.21-linux-glibc2.5-x86_64]# ./scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/3306 --user=mysql
FATAL ERROR: Could not find my-default.cnf
If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.
ln -s /usr/local/src/mysql-5.6.21-linux-glibc2.5-x86_64 /usr/local/mysql
[root@MySQL mysql-5.6.21-linux-glibc2.5-x86_64]# ./scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/3306 --user=mysql
FATAL ERROR: Could not find my-default.cnf
If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.
ln -s /usr/local/src/mysql-5.6.21-linux-glibc2.5-x86_64 /usr/local/mysql
编辑回复