因公司买了国产mips架构服务器,比较小众,MySQL官网大多数都是X86架构安装包,并不提供mips架构现成的安装包,只能使用源码编译进行安装
依赖什么的因为在 机房是内网环境,无法联网,只能说报什么错就去找什么依赖,我也是这么一步步过来的,因为国产系统你懂的
源码包请 选择自带boost的版本,例如:mysql-boost-5.7.33.tar.gz,我的路径是/opt/softapp/下
tar -zxvf mysql-boost-5.7.33.tar.gz
cd mysql-5.7.33/
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DSYSCONFDIR=/etc \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_MEMORY_STORAGE_ENGINE=1 \
-DDEFAULT_STORAGE_ENGINE=InnoDB \
-DWITH_SSL=system \
-DWITH_ZLIB=system \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DENABLE_DOWNLOADS=1 \
-DWITH_EXTRA_CHARSETS=all \
-DWITH_READLINE=1 \
-DWITH_SYSTEMD=1 \
-DWITH_BOOST=/opt/softapp/mysql-5.7.33/boost/boost_1_59_0
useradd -M -s /sbin/nologin -r mysql
mkdir -p /usr/local/mysql/data
chown -R mysql.mysql /usr/local/mysql/
make
sudo make install
mv /etc/my.cnf /etc/my.cnf.bak
vim /etc/my.cnf
[mysql]
default-character-set=utf8
[mysqld]
port=3306
user=mysql
general_log = 1
general_log_file= /var/lib/mysql/mysql.log
socket=/var/lib/mysql/mysql.sock
basedir=/usr/local/mysql
datadir=/usr/local/mysql/data
bind-address = 0.0.0.0
default_storage_engine = InnoDB
character-set-server=utf8
collation-server=utf8_general_ci
lower_case_table_names=1
autocommit=1
symbolic-links=0
skip-networking = 0
log-error=/var/lib/mysql/mysql_err.log
pid-file=/var/lib/mysql/mysql.pid
cd /etc/systemd/system
vim mysqld.service
[Unit]
Description=MySQL DBMS
[Service]
LimitNOFILE=10000
Type=simple
User=mysql
Group=mysql
PIDFile=/usr/local/mysql/mysqld.pid
ExecStart=/usr/local/mysql/bin/mysqld --datadir=/usr/local/mysql/data
ExecStop=/bin/kill -9 $MAINPID
[Install]
WantedBy=multi-user.target
chmod +x mysqld.service
systemctl enable mysqld.service
/usr/local/mysql/bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
[root@localhost system]# /usr/local/mysql/bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
2024-07-07T06:24:46.415658Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2024-07-07T06:24:46.433398Z 0 [ERROR] Could not open file '/var/log/mysql/mysql_err.log' for error logging: No such file or directory
2024-07-07T06:24:46.433548Z 0 [ERROR] Aborting
mkdir /var/log/mysql
touch /var/log/mysql/mysql_err.log
chown -R mysql:mysql /var/log/mysql
systemctl start mysqld
mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'your_password';
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'your_password' WITH GRANT OPTION;
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。