1、创建mysql用户的账号 useradd mysql 2、下载mysql编译好的压缩包 3、安装mysql yum -y install numactl libaio 安装依赖库 tar -zxvf mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz 解压 mv mysql-5.7.25-linux-glibc2.12-x86_64 mysql 改名字 cd mysql 进去mysql cd bin 进去bin文件夹 /usr/local/mysql/bin/mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --initialize 初始化mysql配置文件 2019-03-19T21:22:39.438405Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2019-03-19T21:22:39.780072Z 0 [Warning] InnoDB: New log files created, LSN=45790 2019-03-19T21:22:39.834292Z 0 [Warning] InnoDB: Creating foreign key constraint system tables. 2019-03-19T21:22:39.904779Z 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: 1ffd47ce-4a8d-11e9-bb5c-000c29438466. 2019-03-19T21:22:39.909436Z 0 [Warning] Gtid table is not ready to be used. Table ‘mysql.gtid_executed‘ cannot be opened. 2019-03-19T21:22:39.910139Z 1 [Note] A temporary password is generated for root@localhost: UUo2qa87)ncW 记住最后面初始化密码:UUo2qa87)ncW 安全启动: ./mysqld_safe --user=mysql & (要在mysql安装目录下的bin文件夹目录下) [root@1111 bin]# Logging to ‘/usr/local/mysql/data/1111.err‘. 2019-03-19T21:22:58.875454Z mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data 停留是正常的,这是启动成功了。 ln -s /usr/local/mysql/bin/mysql /usr/bin 创建链接 4、改密码: mysql> ALTER USER USER() IDENTIFIED BY ‘root123‘; (修改密码)
原文:https://www.cnblogs.com/lijibing123456/p/10561648.html