1. 去https://dev.mysql.com/downloads/file/?id=514030 下载mysql-5.7.40-linux-glibc2.12-x86_64.tar,将它scp到目标机器上。保存到/root/tools/下;
2. 执行如下命令,将这个tarball解压成两个文件:
tar -xf mysql-5.7.40-linux-glibc2.12-x86_64.tar
其中一个文件是mysql-5.7.40-linux-glibc2.12-x86_64.tar.gz,另一个文件是mysql-test-5.7.40-linux-glibc2.12-x86_64.tar.gz;
3. 将mysql-5.7.40-linux-glibc2.12-x86_64.tar.gz解压到当前文件夹:
tar -zxvf mysql-5.7.40-linux-glibc2.12-x86_64.tar.gz
这样,mysql就解压到/root/tools/mysql-5.7.40-linux-glibc2.12-x86_64 下了;
4. 将mysql/bin目录配置到path下:
vi /etc/profile ... export MYSQL_HOME=/root/tools/mysql-5.7.40-linux-glibc2.12-x86_64 export PATH=$MYSQL_HOME/bin:$JAVA_HOME/bin:$PATH ... source /etc/profile
5. 执行mysqld --initialize:
[root@localhost ~]# mysqld --initialize 2023-01-03T09:23:17.881654Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2023-01-03T09:23:17.881875Z 0 [ERROR] Can't find error-message file '/usr/local/mysql/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive. 2023-01-03T09:23:18.394574Z 0 [Warning] InnoDB: New log files created, LSN=45790 2023-01-03T09:23:18.466845Z 0 [Warning] InnoDB: Creating foreign key constraint system tables. 2023-01-03T09:23:18.527584Z 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: 4257472a-8b48-11ed-94f0-005056bc0a7f. 2023-01-03T09:23:18.528865Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 2023-01-03T09:23:19.396935Z 0 [Warning] 2023-01-03T09:23:19.396959Z 0 [Warning] 2023-01-03T09:23:19.398153Z 0 [Warning] CA certificate ca.pem is self signed. 2023-01-03T09:23:19.555927Z 1 [Note] A temporary password is generated for root@localhost: zY7)Y;L;3Rio
待续
标签:binary,01,23,mysql,03T09,2023,linux From: https://www.cnblogs.com/zhuyuanfu/p/17022978.html