- 下载安装包:wget https://cdn.mysql.com//archives/mysql-5.7/mysql-boost-5.7.22.tar.gz
- 安装依赖包:zypper install ncurses-devel
- 解压:
tar
-zxf mysql-boost-5.7.22.
tar
.gz -C
/usr/local/
cd
/usr/local/
&&
mv
mysql-5.7.22 mysql
mkdir
/usr/local/mysql/mydata
mkdir
/usr/local/mysql/conf
useradd
-s
/sbin/nologin
-M mysql
chown
-R mysql:mysql
/usr/local/mysql
*
- 编译安装:依赖先安装cmake和gcc,进入mysql目录后执行
linux-et5g:/usr/local/mysql #cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \-DMYSQL_DATADIR=/usr/local/mysql/mydata \-DSYSCONFDIR=/usr/local/mysql/conf \-DMYSQL_USER=mysql \-DWITH_INNODB_MEMCACHED=ON \-DWITH_INNOBASE_STORAGE_ENGINE=1 \-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \-DMYSQL_TCP_PORT=3306 -DEXTRA_CHARSETS=all \-DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci \-DWITH_DEBUG=0 -DMYSQL_MAINTAINER_MODE=0 \-DWITH_SSL:STRING=bundled -DWITH_ZLIB:STRING=bundled \-DWITH_SYSTEMD=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=./boost
linux-et5g:/usr/local/mysql #
make
&&
make
install
- 初始化mysql
root@ubuntu:/usr/local/mysql/bin# vim /etc/my.cnf
[mysqld]bind-address=0.0.0.0port=3306user=mysqlbasedir=/usr/local/mysqldatadir=/usr/local/mysql/mydatasocket=/tmp/mysql.socklog-error=/usr/local/mysql/mysql.errpid-file=/usr/local/mysql/mysql.pid#character configcharacter_set_server=utf8mb4symbolic-links=0explicit_defaults_for_timestamp=true
root@ubuntu:/usr/local/mysql/bin#./mysqld --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/mydata/ --user=mysql --initialize
cat /usr/local/mysql/mysql.err
启动mysql,并更改root 密码先将mysql.server放置到/etc/init.d/mysql中
cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql启动!!!systemctl daemon-reloadservice mysql startps -ef|grep mysql
https://blog.csdn.net/qq_37598011/article/details/93489404