mysql编译好的简单安装

时间:2021-01-05 03:17:48
、创建mysql用户的账号
useradd mysql 、下载mysql编译好的压缩包 、安装mysql
yum -y install numactl libaio 安装依赖库
tar -zxvf mysql-5.7.-linux-glibc2.-x86_64.tar.gz 解压 mv mysql-5.7.-linux-glibc2.-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配置文件 --19T21::.438405Z [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
--19T21::.780072Z [Warning] InnoDB: New log files created, LSN=
--19T21::.834292Z [Warning] InnoDB: Creating foreign key constraint system tables.
--19T21::.904779Z [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.
--19T21::.909436Z [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
--19T21::.910139Z [Note] A temporary password is generated for root@localhost: UUo2qa87)ncW
记住最后面初始化密码:UUo2qa87)ncW 安全启动: ./mysqld_safe --user=mysql & (要在mysql安装目录下的bin文件夹目录下) [root@ bin]# Logging to '/usr/local/mysql/data/1111.err'.
--19T21::.875454Z mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data 停留是正常的,这是启动成功了。
[root@localhost bin]# 2019-03-15T18:51:18.777280Z mysqld_safe Logging to '/var/log/mysqld.log'.
2019-03-15T18:51:18.780334Z mysqld_safe Directory '/var/lib/mysql' for UNIX socket file don't exists. 这个报错,就删掉/etc/my.cnf再重新启动

  

ln -s /usr/local/mysql/bin/mysql /usr/bin 创建链接 、改密码: mysql> ALTER USER USER() IDENTIFIED BY 'root123'; (修改密码)