cmake . \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_INSTALL_PREFIX:PATH=/usr/local/mysql \
-DCOMMUNITY_BUILD:BOOL=ON \
-DENABLED_PROFILING:BOOL=ON \
-DENABLE_DEBUG_SYNC:BOOL=OFF \
-DINSTALL_LAYOUT:STRING=STANDALONE \
-DMYSQL_DATADIR:PATH=/var/run/mysql \
-DMYSQL_MAINTAINER_MODE:BOOL=OFF \
-DWITH_EMBEDDED_SERVER:BOOL=ON \
-DWITH_EXTRA_CHARSETS:STRING=all \
-DWITH_SSL:STRING=bundled \
-DWITH_UNIT_TESTS:BOOL=OFF \
-DWITH_ZLIB:STRING=bundled \
-LH
make
make install
# End of source-build specific instructions
# Postinstallation setup
cd /usr/local/mysql
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql
make install
# End of source-build specific instructions
# Postinstallation setup
cd /usr/local/mysql
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql
(
mysql_install_db--user=mysql --basedir=/usr/local/mysql--datadir=/usr/local/mysql/data
)
chown -R root.
chown -R mysqldata
chgrp -R mysqldata
cpsupport-files/my-medium.cnf /etc/my.cnf#optional
bin/mysqld_safe--user=mysql &
cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysql.server # Optional
启动mysql出现下面提示估计是没有权限
/usr/local/mysql/bin/mysqld: File'./mysql-bin.index' not found (Errcode: 13)
经过排查原来数据库目录变成data了不是var/data了 所以vi /etc/my.cnf
datadir=/usr/local/mysql/data添加这个设置一下目录启动成功
chown -R mysqldata
chgrp -R mysqldata
cpsupport-files/my-medium.cnf /etc/my.cnf#optional
bin/mysqld_safe--user=mysql &
cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysql.server # Optional
启动mysql出现下面提示估计是没有权限
/usr/local/mysql/bin/mysqld: File'./mysql-bin.index' not found (Errcode: 13)
经过排查原来数据库目录变成data了不是var/data了 所以vi /etc/my.cnf
datadir=/usr/local/mysql/data添加这个设置一下目录启动成功