LINUX1012 mysql GLIBC安装



bash 复制代码
PS C:\Users\11400> get-process | where-Object {$_.ProcessName -like "*vmware" }

Handles  NPM(K)    PM(K)      WS(K)     CPU(s)     Id  SI ProcessName
-------  ------    -----      -----     ------     --  -- -----------
    717      60    78440     129680      10.34  12940   1 vmware


bash 复制代码
[root@client caozx26]# cd /mysql_3306/
[root@client mysql_3306]# chown mysql:mysql mysql-files/
[root@client mysql_3306]# chmod 750 mysql-files/
[root@client mysql_3306]# bin/mysqld --initialize --user=mysql --basedir=/mysql_3306
bash: bin/mysqld: 没有那个文件或目录
[root@client mysql_3306]# ls
bash 复制代码
[root@client mysql-5.7.31-linux-glibc2.12-x86_64]# ls
bin  docs  include  lib  LICENSE  man  README  share  support-files
[root@client mysql-5.7.31-linux-glibc2.12-x86_64]# bin/mysqld --initialize --user=mysql --basedir=/mysql_3306
2025-10-21T12:33:52.201947Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2025-10-21T12:33:52.202110Z 0 [ERROR] Can't find error-message file '/mysql_3306/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2025-10-21T12:33:52.431990Z 0 [Warning] InnoDB: New log files created, LSN=45790
2025-10-21T12:33:52.484193Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2025-10-21T12:33:52.545787Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 33b87f2c-ae7a-11f0-9e30-000c29d284d0.
2025-10-21T12:33:52.546669Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2025-10-21T12:33:52.964540Z 0 [Warning] CA certificate ca.pem is self signed.
2025-10-21T12:33:53.032847Z 1 [Note] A temporary password is generated for root@localhost: mdNnDeI:i1*_
[root@client mysql-5.7.31-linux-glibc2.12-x86_64]#
bash 复制代码
[root@client mysql_3306]# ls
data  mysql-5.7.31-linux-glibc2.12-x86_64  mysql-files
[root@client mysql_3306]# bin/mysqld --initialize --user=mysql --basedir=/mysql_3306
bash: bin/mysqld: 没有那个文件或目录
[root@client mysql_3306]#

Mysql GLIBC安装

bash 复制代码
[root@client caozx26]# tar -xf mysql-5.7.31-linux-glibc2.12-x86_64.tar\(1\).gz
[root@client caozx26]# ls mysql-5.7.31-linux-glibc2.12-x86_64
bin  docs  include  lib  LICENSE  man  README  share  support-files
[root@client caozx26]# rm -rf /etc/my.cnf
[root@client caozx26]# mv mysql-5.7.31-linux-glibc2.12-x86_64 /mysql_3306/
[root@client caozx26]# cd /mysql_3306/
[root@client mysql_3306]# ls
mysql-5.7.31-linux-glibc2.12-x86_64
[root@client mysql_3306]# rm -f
[root@client mysql_3306]# ls
mysql-5.7.31-linux-glibc2.12-x86_64
[root@client mysql_3306]# rm -rf mysql-5.7.31-linux-glibc2.12-x86_64/
[root@client mysql_3306]# ls
[root@client mysql_3306]# cd /home/caozx26
[root@client caozx26]# ls
1828.txt  2.txt   app1                inotify-tools-3.13.tar.gz                      模板  桌面
1837.txt  35.txt  a.txt               mysql-5.7.31-linux-glibc2.12-x86_64.tar(1).gz  视频
1.java    3.java  b.txt               mysql-boost-5.7.31.tar(1).gz                   图片
1.txt     4.java  file22.txt          sed.sh                                         文档
2041      5.java  ifcfg-ens33         smb.conf                                       下载
2.java    app     inotify-tools-3.13  公共                                           音乐
[root@client caozx26]# ls
1828.txt  2.txt   app1                inotify-tools-3.13.tar.gz                      模板  桌面
1837.txt  35.txt  a.txt               mysql-5.7.31-linux-glibc2.12-x86_64.tar(1).gz  视频
1.java    3.java  b.txt               mysql-boost-5.7.31.tar(1).gz                   图片
1.txt     4.java  file22.txt          sed.sh                                         文档
2041      5.java  ifcfg-ens33         smb.conf                                       下载
2.java    app     inotify-tools-3.13  公共                                           音乐
[root@client caozx26]# tar -xf mysql-5.7.31-linux-glibc2.12-x86_64.tar\(1\).gz
[root@client caozx26]# ls mysql-5.7.31-linux-glibc2.12-x86_64
bin  docs  include  lib  LICENSE  man  README  share  support-files
[root@client caozx26]# mv mysql-5.7.31-linux-glibc2.12-x86_64 /mysql_3306
[root@client caozx26]# ls /mysql_3306/
mysql-5.7.31-linux-glibc2.12-x86_64
[root@client caozx26]# cd /mysql_3306/
[root@client mysql_3306]# ls
mysql-5.7.31-linux-glibc2.12-x86_64
[root@client mysql_3306]# mv mysql-5.7.31-linux-glibc2.12-x86_64/* /mysql_3306/
[root@client mysql_3306]# ls
bin  docs  include  lib  LICENSE  man  mysql-5.7.31-linux-glibc2.12-x86_64  README  share  support-files
[root@client mysql_3306]# bin/mysqld --initialize --user=mysql --basedir=/mysql_3306
2025-10-21T13:08:18.206312Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2025-10-21T13:08:18.364918Z 0 [Warning] InnoDB: New log files created, LSN=45790
2025-10-21T13:08:18.414716Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2025-10-21T13:08:18.507732Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 032145cf-ae7f-11f0-9f3f-000c29d284d0.
2025-10-21T13:08:18.508485Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2025-10-21T13:08:18.910349Z 0 [Warning] CA certificate ca.pem is self signed.
2025-10-21T13:08:19.055680Z 1 [Note] A temporary password is generated for root@localhost: tlDlr+Urf0f9
[root@client mysql_3306]# bin/mysql_ssl_rsa_setup --datadir=/mysql_3306/data
[root@client mysql_3306]# cp support-files/mysql.server /etc/init.d/mysql_3306
[root@client mysql_3306]# vim /etc/init.d/mysql_3306
[root@client mysql_3306]# service mysql_3306 start
Starting MySQL.Logging to '/mysql_3306/data/client.backup.cn.err'.
 SUCCESS!
[root@client mysql_3306]#

yum install libaio -y

安装依赖库libaio

tar -xf mysql-x.x.xx-linux-glibc .tar.gz

useradd -r -s /sbin/nologin mysql

创建数据库专用账号mysql

rm -rf /etc/my.cnf

清空系统中mariadb配置文件

移动

mkdir /mysql_3306

mv mysql-/* /mysql_3306

mkdir mysql-files

cd /mysql_3306

mkdir mysql-files

chown mysql:mysql mysql-files

chmod 750 mysql-files

更改权限

bin/mysqld --initialize --user=mysql --basedir=/mysql

初始化数据库

bin/mysql_ssl_rsa_setup --datadir=/mysql_3306/data

设置安全加密连接

cp support-files/mysql.server /etc/init.d/mysql_3306

vim /etc/init.d/mysql_3306

bash 复制代码
basedir=/mysql_3306
datadir=/mysql_3306/data

service mysql_3306 start

记录

bash 复制代码
caozx26@192.168.235.200's password:
     ┌────────────────────────────────────────────────────────────────────┐
     │                        • MobaXterm 20.0 •                          │
     │            (SSH client, X-server and networking tools)             │
     │                                                                    │
     │ ➤ SSH session to caozx26@192.168.235.200                           │
     │   • SSH compression : ✘                                            │
     │   • SSH-browser     : ✔                                            │
     │   • X11-forwarding  : ✔  (remote display is forwarded through SSH) │
     │   • DISPLAY         : ✔  (automatically set on remote server)      │
     │                                                                    │
     │ ➤ For more info, ctrl+click on help or visit our website           │
     └────────────────────────────────────────────────────────────────────┘

Last login: Tue Oct 21 19:29:55 2025
[caozx26@client ~]$ sudo su
[sudo] caozx26 的密码:
[root@client caozx26]# cd /mysql_3306/
[root@client mysql_3306]# chown mysql:mysql mysql-files/
[root@client mysql_3306]# chmod 750 mysql-files/
[root@client mysql_3306]# bin/mysqld --initialize --user=mysql --basedir=/mysql_3306
bash: bin/mysqld: 没有那个文件或目录
[root@client mysql_3306]# ls
mysql-5.7.31-linux-glibc2.12-x86_64  mysql-files
[root@client mysql_3306]# cd ~
[root@client ~]# ls
anaconda-ks.cfg  expect3.sh  id_rsa.pub            ip.txt  rsync_java.sh
expect2.sh       expect4.sh  initial-setup-ks.cfg  pub1
[root@client ~]# cd /
[root@client /]# ls
123.txt  b       boot  d     e    g      id_rsa.pub  lib64  mysql_3306  root  share  test  var
76       backup  c     data  etc  home   k           media  opt         run   srv    tmp
a        bin     code  dev   f    hosts  lib         mnt    proc        sbin  sys    usr
[root@client /]# cd /home/caozx26/
[root@client caozx26]# l;s
bash: l: 未找到命令...
bash: s: 未找到命令...
[root@client caozx26]# ks
bash: ks: 未找到命令...
[root@client caozx26]# ls
1828.txt  2.txt   app1                inotify-tools-3.13.tar.gz                      模板  桌面
1837.txt  35.txt  a.txt               mysql-5.7.31-linux-glibc2.12-x86_64.tar(1).gz  视频
1.java    3.java  b.txt               mysql-boost-5.7.31.tar(1).gz                   图片
1.txt     4.java  file22.txt          sed.sh                                         文档
2041      5.java  ifcfg-ens33         smb.conf                                       下载
2.java    app     inotify-tools-3.13  公共                                           音乐
[root@client caozx26]# cd /mysql_3306/
[root@client mysql_3306]# ls
mysql-5.7.31-linux-glibc2.12-x86_64  mysql-files
[root@client mysql_3306]# cd mysql-5.7.31-linux-glibc2.12-x86_64/
[root@client mysql-5.7.31-linux-glibc2.12-x86_64]# ls
bin  docs  include  lib  LICENSE  man  README  share  support-files
[root@client mysql-5.7.31-linux-glibc2.12-x86_64]# bin/mysqld --initialize --user=mysql --basedir=/mysql_3306
2025-10-21T12:33:52.201947Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2025-10-21T12:33:52.202110Z 0 [ERROR] Can't find error-message file '/mysql_3306/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2025-10-21T12:33:52.431990Z 0 [Warning] InnoDB: New log files created, LSN=45790
2025-10-21T12:33:52.484193Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2025-10-21T12:33:52.545787Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 33b87f2c-ae7a-11f0-9e30-000c29d284d0.
2025-10-21T12:33:52.546669Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2025-10-21T12:33:52.964540Z 0 [Warning] CA certificate ca.pem is self signed.
2025-10-21T12:33:53.032847Z 1 [Note] A temporary password is generated for root@localhost: mdNnDeI:i1*_
[root@client mysql-5.7.31-linux-glibc2.12-x86_64]# bin/mysqld --initialize --user=mysql --basedir=/mysql_3306
2025-10-21T12:38:47.158825Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2025-10-21T12:38:47.158922Z 0 [ERROR] Can't find error-message file '/mysql_3306/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2025-10-21T12:38:47.159390Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2025-10-21T12:38:47.159414Z 0 [ERROR] Aborting

[root@client mysql-5.7.31-linux-glibc2.12-x86_64]# cd ~
[root@client ~]# ls
anaconda-ks.cfg  expect3.sh  id_rsa.pub            ip.txt  rsync_java.sh
expect2.sh       expect4.sh  initial-setup-ks.cfg  pub1
[root@client ~]# cd /mysql_3306/
[root@client mysql_3306]# ls
data  mysql-5.7.31-linux-glibc2.12-x86_64  mysql-files
[root@client mysql_3306]# cd mysql-5.7.31-linux-glibc2.12-x86_64/
[root@client mysql-5.7.31-linux-glibc2.12-x86_64]# ls
bin  docs  include  lib  LICENSE  man  README  share  support-files
[root@client mysql-5.7.31-linux-glibc2.12-x86_64]# cd ~
[root@client ~]# ls
anaconda-ks.cfg  expect3.sh  id_rsa.pub            ip.txt  rsync_java.sh
expect2.sh       expect4.sh  initial-setup-ks.cfg  pub1
[root@client ~]# cd /mysql_3306/
[root@client mysql_3306]# ls
data  mysql-5.7.31-linux-glibc2.12-x86_64  mysql-files
[root@client mysql_3306]# bin/mysqld --initialize --user=mysql --basedir=/mysql_3306
bash: bin/mysqld: 没有那个文件或目录
[root@client mysql_3306]# cd mysql-5.7.31-linux-glibc2.12-x86_64/
[root@client mysql-5.7.31-linux-glibc2.12-x86_64]# ls
bin  docs  include  lib  LICENSE  man  README  share  support-files
[root@client mysql-5.7.31-linux-glibc2.12-x86_64]# ls -l bin
总用量 692052
-rwxr-xr-x 1 7161 31415   8109910 6月   2 2020 innochecksum
-rwxr-xr-x 1 7161 31415    236870 6月   2 2020 lz4_decompress
-rwxr-xr-x 1 7161 31415  10029434 6月   2 2020 myisamchk
-rwxr-xr-x 1 7161 31415   9572063 6月   2 2020 myisam_ftdump
-rwxr-xr-x 1 7161 31415   7475370 6月   2 2020 myisamlog
-rwxr-xr-x 1 7161 31415   9696695 6月   2 2020 myisampack
-rwxr-xr-x 1 7161 31415   7399682 6月   2 2020 my_print_defaults
-rwxr-xr-x 1 7161 31415  10355627 6月   2 2020 mysql
-rwxr-xr-x 1 7161 31415   9211866 6月   2 2020 mysqladmin
-rwxr-xr-x 1 7161 31415  11184624 6月   2 2020 mysqlbinlog
-rwxr-xr-x 1 7161 31415   9582954 6月   2 2020 mysqlcheck
-rwxr-xr-x 1 7161 31415      5245 6月   2 2020 mysql_config
-rwxr-xr-x 1 7161 31415   7576575 6月   2 2020 mysql_config_editor
-rwxr-xr-x 1 7161 31415 254824985 6月   2 2020 mysqld
-rwxr-xr-x 1 7161 31415     27139 6月   2 2020 mysqld_multi
-rwxr-xr-x 1 7161 31415     27836 6月   2 2020 mysqld_safe
-rwxr-xr-x 1 7161 31415   9485037 6月   2 2020 mysqldump
-rwxr-xr-x 1 7161 31415      7865 6月   2 2020 mysqldumpslow
-rwxr-xr-x 1 7161 31415 219115876 6月   2 2020 mysql_embedded
-rwxr-xr-x 1 7161 31415   9234535 6月   2 2020 mysqlimport
-rwxr-xr-x 1 7161 31415   9714647 6月   2 2020 mysql_install_db
-rwxr-xr-x 1 7161 31415   7463251 6月   2 2020 mysql_plugin
-rwxr-xr-x 1 7161 31415  17468589 6月   2 2020 mysqlpump
-rwxr-xr-x 1 7161 31415   9163335 6月   2 2020 mysql_secure_installation
-rwxr-xr-x 1 7161 31415   9171220 6月   2 2020 mysqlshow
-rwxr-xr-x 1 7161 31415   9275194 6月   2 2020 mysqlslap
-rwxr-xr-x 1 7161 31415   7784350 6月   2 2020 mysql_ssl_rsa_setup
-rwxr-xr-x 1 7161 31415   5111610 6月   2 2020 mysql_tzinfo_to_sql
-rwxr-xr-x 1 7161 31415  12422038 6月   2 2020 mysql_upgrade
-rwxr-xr-x 1 7161 31415   7538509 6月   2 2020 perror
-rwxr-xr-x 1 7161 31415   5329503 6月   2 2020 replace
-rwxr-xr-x 1 7161 31415   7396104 6月   2 2020 resolveip
-rwxr-xr-x 1 7161 31415   7485332 6月   2 2020 resolve_stack_dump
-rwxr-xr-x 1 7161 31415    112619 6月   2 2020 zlib_decompress
[root@client mysql-5.7.31-linux-glibc2.12-x86_64]# cd /home/caozx26
[root@client caozx26]# ls
1828.txt  2.txt   app1                inotify-tools-3.13.tar.gz                      模板  桌面
1837.txt  35.txt  a.txt               mysql-5.7.31-linux-glibc2.12-x86_64.tar(1).gz  视频
1.java    3.java  b.txt               mysql-boost-5.7.31.tar(1).gz                   图片
1.txt     4.java  file22.txt          sed.sh                                         文档
2041      5.java  ifcfg-ens33         smb.conf                                       下载
2.java    app     inotify-tools-3.13  公共                                           音乐
[root@client caozx26]# rm -rf /mysql_3306
[root@client caozx26]# ls
1828.txt  2.txt   app1                inotify-tools-3.13.tar.gz                      模板  桌面
1837.txt  35.txt  a.txt               mysql-5.7.31-linux-glibc2.12-x86_64.tar(1).gz  视频
1.java    3.java  b.txt               mysql-boost-5.7.31.tar(1).gz                   图片
1.txt     4.java  file22.txt          sed.sh                                         文档
2041      5.java  ifcfg-ens33         smb.conf                                       下载
2.java    app     inotify-tools-3.13  公共                                           音乐
[root@client caozx26]# mkdir /mysql_3306
[root@client caozx26]# tar -xf mysql-5.7.31-linux-glibc2.12-x86_64.tar\(1\).gz
[root@client caozx26]# ls mysql-5.7.31-linux-glibc2.12-x86_64
bin  docs  include  lib  LICENSE  man  README  share  support-files
[root@client caozx26]# rm -rf /etc/my.cnf
[root@client caozx26]# mv mysql-5.7.31-linux-glibc2.12-x86_64 /mysql_3306/
[root@client caozx26]# cd /mysql_3306/
[root@client mysql_3306]# ls
mysql-5.7.31-linux-glibc2.12-x86_64
[root@client mysql_3306]# rm -f
[root@client mysql_3306]# ls
mysql-5.7.31-linux-glibc2.12-x86_64
[root@client mysql_3306]# rm -rf mysql-5.7.31-linux-glibc2.12-x86_64/
[root@client mysql_3306]# ls
[root@client mysql_3306]# cd /home/caozx26
[root@client caozx26]# ls
1828.txt  2.txt   app1                inotify-tools-3.13.tar.gz                      模板  桌面
1837.txt  35.txt  a.txt               mysql-5.7.31-linux-glibc2.12-x86_64.tar(1).gz  视频
1.java    3.java  b.txt               mysql-boost-5.7.31.tar(1).gz                   图片
1.txt     4.java  file22.txt          sed.sh                                         文档
2041      5.java  ifcfg-ens33         smb.conf                                       下载
2.java    app     inotify-tools-3.13  公共                                           音乐
[root@client caozx26]# ls
1828.txt  2.txt   app1                inotify-tools-3.13.tar.gz                      模板  桌面
1837.txt  35.txt  a.txt               mysql-5.7.31-linux-glibc2.12-x86_64.tar(1).gz  视频
1.java    3.java  b.txt               mysql-boost-5.7.31.tar(1).gz                   图片
1.txt     4.java  file22.txt          sed.sh                                         文档
2041      5.java  ifcfg-ens33         smb.conf                                       下载
2.java    app     inotify-tools-3.13  公共                                           音乐
[root@client caozx26]# tar -xf mysql-5.7.31-linux-glibc2.12-x86_64.tar\(1\).gz
[root@client caozx26]# ls mysql-5.7.31-linux-glibc2.12-x86_64
bin  docs  include  lib  LICENSE  man  README  share  support-files
[root@client caozx26]# mv mysql-5.7.31-linux-glibc2.12-x86_64 /mysql_3306
[root@client caozx26]# ls /mysql_3306/
mysql-5.7.31-linux-glibc2.12-x86_64
[root@client caozx26]# cd /mysql_3306/
[root@client mysql_3306]# ls
mysql-5.7.31-linux-glibc2.12-x86_64
[root@client mysql_3306]# mv mysql-5.7.31-linux-glibc2.12-x86_64/* /mysql_3306/
[root@client mysql_3306]# ls
bin  docs  include  lib  LICENSE  man  mysql-5.7.31-linux-glibc2.12-x86_64  README  share  support-files
[root@client mysql_3306]# bin/mysqld --initialize --user=mysql --basedir=/mysql_3306
2025-10-21T13:08:18.206312Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2025-10-21T13:08:18.364918Z 0 [Warning] InnoDB: New log files created, LSN=45790
2025-10-21T13:08:18.414716Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2025-10-21T13:08:18.507732Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 032145cf-ae7f-11f0-9f3f-000c29d284d0.
2025-10-21T13:08:18.508485Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2025-10-21T13:08:18.910349Z 0 [Warning] CA certificate ca.pem is self signed.
2025-10-21T13:08:19.055680Z 1 [Note] A temporary password is generated for root@localhost: tlDlr+Urf0f9
[root@client mysql_3306]# bin/mysql_ssl_rsa_setup --datadir=/mysql_3306/data
[root@client mysql_3306]# cp support-files/mysql.server /etc/init.d/mysql_3306
[root@client mysql_3306]# vim /etc/init.d/mysql_3306
[root@client mysql_3306]# service mysql_3306 start
Starting MySQL.Logging to '/mysql_3306/data/client.backup.cn.err'.
 SUCCESS!
[root@client mysql_3306]#
相关推荐
小草儿7993 小时前
gbase8s之.net8连接8s之mysql模式(windows)demo
windows·mysql·.net
DemonAvenger3 小时前
深入 Redis Hash:从原理到实战,10 年经验的后端工程师带你玩转哈希结构
数据库·redis·性能优化
sakoba4 小时前
MySQL的json处理相关方法
android·学习·mysql·json
❥ღ Komo·4 小时前
PHP数据库操作全攻略
数据库·oracle
程序新视界4 小时前
MySQL的整体架构及功能详解
数据库·后端·mysql
ANYOLY4 小时前
MySQL索引指南
数据库·mysql
怪兽20145 小时前
Redis过期键的删除策略有哪些?
java·数据库·redis·缓存·面试
骑士雄师6 小时前
使用 IntelliJ IDEA 结合 DBeaver 连接 MySQL 数据库并实现数据增删查改的详细步骤:
数据库·mysql·intellij-idea
b78gb8 小时前
电商秒杀系统设计 Java+MySQL实现高并发库存管理与订单处理
java·开发语言·mysql