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]#
相关推荐
嘻哈baby6 分钟前
MySQL索引设计避坑指南:这些错误别再犯了
mysql
男孩李12 分钟前
浅谈PostgreSQL 模式(SCHEMA)
数据库·postgresql
q_191328469512 分钟前
基于Springboot+Vue.js的工业人身安全监测系统
vue.js·spring boot·后端·mysql·计算机毕业设计·串口通讯
TG:@yunlaoda360 云老大17 分钟前
如何在华为云国际站代理商控制台进行基础状态核查的常见问题解答
数据库·华为云·php
CeshirenTester30 分钟前
Cursor自动调试代码实战教程
数据库·oracle
老马952731 分钟前
事务工具类
数据库·后端
小张是铁粉41 分钟前
oracle 数据库学习之体系结构(1-4章)
数据库·学习
TH_143 分钟前
22、oracle导入数据,sys_user表数据错误
数据库·oracle
严文文-Chris1 小时前
【向量数据库到底是什么?】
数据库
老马聊技术1 小时前
HBase单节点环境搭建详细教程
大数据·数据库·hbase