您当前的位置: 首页 > 学无止境 > 心得笔记 网站首页心得笔记
mysql5.7在centos7.6中的二进制源码包安装
发布时间:2019-06-30 19:10:03编辑:雪饮阅读()
环境:
mysql-5.7.26-linux-glibc2.12-x86_64
centos7.6_x86_64
移除默认的mariadb
[root@localhost ~]# rpm -qa |grep mariadb
mariadb-libs-5.5.60-1.el7_5.x86_64
[root@localhost ~]# rpm -e --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64
配置
准备mysql用户和数据存储目录、源码部署
useradd -r mysql
mkdir /mydata
ln -sv /usr/local/src/mysql-5.7.26-linux-glibc2.12-x86_64 /usr/local/mysql
授权
cd /usr/local/mysql
chown -R root.mysql ./*
chown -R mysql.mysql /mydata
准备配置文件
[root@localhost mysql]# cat /etc/my.cnf
[mysql]
socket=/mydata/mysql.sock
[mysqld]
socket=/mydata/mysql.sock
basedir=/usr/local/mysql
datadir=/mydata
pid_file =/mydata/mysql.pid
初始化
[root@localhost mysql]# ./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/mydata
2019-06-30T17:39:01.245152Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-06-30T17:39:02.097208Z 0 [Warning] InnoDB: New log files created, LSN=45790
2019-06-30T17:39:02.241001Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-06-30T17:39:02.307814Z 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: f306b658-9b5d-11e9-a520-000c29659032.
2019-06-30T17:39:02.310761Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2019-06-30T17:39:02.312509Z 1 [Note] A temporary password is generated for root@localhost: ZfsiG6-pv#/(
这里标红部分是初始化后给你生成的默认密码,要记住,在后面登录的时候是需要用到的
启动服务
[root@localhost mysql]# ./support-files/mysql.server start
Starting MySQL.Logging to '/mydata/localhost.localdomain.err'.
SUCCESS!
修改默认密码
[root@localhost mysql]# ./bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.26 MySQL Community Server (GPL)
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> set password='xy220807';
Query OK, 0 rows affected (0.00 sec)
mysql>
关键字词:mysql5.7.26,centos7.6
相关文章
-
无相关信息