Under Arch Linux, install mysql 8
==========================
$ sudo pacman -S mysql
$ sudo systemctl start mysql.service (启动失败)$journalctl -xeu mysqld.service
arch linux mysql Table 'mysql.plugin' doesn't exist Please perform the MySQL upgrade procedure
solution:
清除目录: /var/lib/mysql 内容, 就好了
sudo mysqld --initialize --user=mysql
跟着测试用空密码就不能登录:
mysql -uroot -p
"sudo mysqld --initialize --user=mysql" 的时候给了一次性密码, 需要立即修改密码
你用它登录后马上改密码就ok了
mysql -uroot -p"${defaultmysqlpwd}" --connect-expired-password <<...EOF...
ALTER USER 'root'@'localhost' IDENTIFIED BY "$newmysqlpwd";
...EOF...
ref:
https://unix.stackexchange.com/questions/669809/problem-running-mysql-in-arch-linux
==> https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization.html#data-directory-initialization-overview