mysql glibc_mysql-5.7.17-linux-glibc2.5 的免编译安装

1 . 从官网下载 mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz

2.检查你所用的Linux下有没有安装过mysql,没有卸载干净

rpm -q mysql

3. 卸载mysql

rpm -e mysql --nodeps

4. 创建mysql的用户和组

useradd mysql

5. 解压 mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz

tar zxf mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz

6. 移动解压后的问价并重新命名为mysql

mv mysql-5.7.17-linux-glibc2.5-x86_64 /usr/local/mysql

7. 更改属主属组

chown -R mysql:mysql /usr/local/mysql/

8.进入/usr/local/mysql, 并初始化数据库

cd /usr/local/mysql

./bin/mysqld --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --initialize

2018-01-17T07:41:02.340159Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2018-01-17T07:41:02.340257Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.

2018-01-17T07:41:02.340264Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.

2018-01-17T07:41:02.804107Z 0 [Warning] InnoDB: New log files created, LSN=45790

2018-01-17T07:41:02.876235Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.

2018-01-17T07:41:02.939354Z 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: c4bbd03c-fb59-11e7-87f7-5254002afcc1.

2018-01-17T07:41:02.942346Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.

2018-01-17T07:41:02.943669Z 1 [Note] A temporary password is generated for root@localhost: k!lGGrWng3qP

上面结果最后一个是mysql的初始密码。

9. 启动mysql

./support-files/mysql.server start

启动mysql数据库服务。

10.创建软连接

ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql

客户端命令操作需要用到。

11. 创建配置文件并添加服务端启动脚本到系统启动脚本

cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf

cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld

chmod 755 /etc/init.d/mysqld

重启mysql 即可安装成功。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值