老男孩mysql系列 1_Mysql 8.0常规安装

2019-10-12  本文已影响0人  若有所思11
1. MySQL安装准备
2. MySQL Linux 安装
image.png
安装rz命令
yum install lrzsz
cd /usr/local/
tar -xvf mysql-8.0.17-linux-glibc2.12-x86_64.tar
tar -xvf mysql-8.0.17-linux-glibc2.12-x86_64.tar.xz
mv mysql-8.0.17-linux-glibc2.12-x86_64 mysql
Shell> groupadd mysql
Shell> useradd mysql -g mysql
Shell> cd /usr/local/mysql
Shell> chown mysql:mysql data

2019-10-12T02:46:14.688780Z 0 [System] [MY-013169] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.17) initializing of server in progress as process 2774
2019-10-12T02:46:20.508655Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: *i#XxXwi>4Qh ##密码
2019-10-12T02:46:23.080522Z 0 [System] [MY-013170] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.17) initializing of server has completed

shell> cp /support-files/mysql.server /etc/init.d/ ##将默认配置文件复制到指定目录
shell> bin/mysqld_safe --datadir=/usr/local/mysql/data --user=mysql & ##启动MySQL服务
shell> cp support-files/mysql.server /etc/init.d/mysql.server ##将MySQL加入到服务自启动
Shell> /etc/init.d/mysql.server start ##通过服务启动MySQL

[root@oracle12c support-files]# /etc/init.d/mysql.server start
Starting MySQL.Logging to '/usr/local/mysql/data/oracle12c.err'.
[ OK ]

[root@localhost mysql]# bin/mysqld --initialize --user=mysql --datadir
/usr/local/mysql/data/bin/mysqld: error while loading shared libraries: libaio.so.1: cannot openshared object file: No such file or directory

则需要安装包
yum install -y libaio

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

alter user user() identified by 'mysql';
mysql 8.0之前可以通过set password=password('mysql');修改密码

上一篇 下一篇

猜你喜欢

热点阅读