manjaro 安装 mysql8

安装:

1
sudo pacman -Syy mysql

初始化:

1
mysqld --initialize --user=mysql --basedir=/usr --datadir=/data/mysql

输出:

1
2
3
4
2018-10-24T02:50:36.847221Z 0 [Warning] [MY-010915] [Server] '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-10-24T02:50:36.847280Z 0 [System] [MY-013169] [Server] /usr/bin/mysqld (mysqld 8.0.12) initializing of server in progress as process 20967
2018-10-24T02:50:42.842042Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: lukgZCev*3To
2018-10-24T02:50:45.684453Z 0 [System] [MY-013170] [Server] /usr/bin/mysqld (mysqld 8.0.12) initializing of server has completed

启动:

1
systemctl start mysqld

使用临时密码登录并修改密码:

1
2
3
mysql -u root -p
>ALTER user 'root'@'localhost' IDENTIFIED BY '123456';
>flush privileges;