码迷,mamicode.com
首页 > 数据库 > 详细

mysql-8.0.25_centos7_tar启动

时间:2021-06-06 19:41:07      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:dir   rate   数据库   com   sys   cal   create   ali   download   

1.下载mysql-8.0.25(https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.25-el7-x86_64.tar.gz)

2.上传到 /usr/local/mysql 目录,执行 tar -zxvf /usr/local/mysqlmysql-8.0.25-el7-x86_64.tar.gz 

3.执行 /usr/local/mysqlmysql-8.0.25-el7-x86_64/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/mysql-8.0.25-el7-x86_64 --datadir=/usr/local/mysql/mysql-8.0.25-el7-x86_64/data --pid-file=/usr/local/mysql/mysql-8.0.25-el7-x86_64/data/mysql.pid --explicit_defaults_for_timestamp (目的:以root用户名启动,初始化数据库,生产随机密码)

  执行结果:

[root@hadoop03 mysql-8.0.25-el7-x86_64]# ./bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql/mysql-8.0.25-el7-x86_64 --datadir=/usr/local/mysql/mysql-8.0.25-el7-x86_64/data --pid-file=/usr/local/mysql/mysql-8.0.25-el7-x86_64/data/mysql.pid --explicit_defaults_for_timestamp
2021-06-06T06:27:44.224106Z 0 [System] [MY-013169] [Server] /usr/local/mysql/mysql-8.0.25-el7-x86_64/bin/mysqld (mysqld 8.0.25) initializing of server in progress as process 80717
2021-06-06T06:27:44.238078Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-06-06T06:27:45.442357Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-06-06T06:27:48.173559Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: jma*_HL2yyzo

4.启动mysql服务 /usr/local/mysqlmysql-8.0.25-el7-x86_64/bin/mysqld &(最后的&为后台启动,可不写)

5.进入mysql /usr/local/mysqlmysql-8.0.25-el7-x86_64/bin/mysql -uroot -pjma*_HL2yyzo(密码为上面产生的随机密码)

7.修改密码并设置远程可连:

mysql> ALTER USERroot@localhost IDENTIFIED BY 123456;
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE USER root@% IDENTIFIED BY 123456;
Query OK, 0 rows affected (0.02 sec)

mysql> GRANT ALL PRIVILEGES ON *.* TO root@% WITH GRANT OPTION;
Query OK, 0 rows affected (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

 

mysql-8.0.25_centos7_tar启动

标签:dir   rate   数据库   com   sys   cal   create   ali   download   

原文地址:https://www.cnblogs.com/panxiyao/p/14855571.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!