manjaro gome下安装配置MySQL

sudo pacman -S mysql
sudo mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql

如果成功,terminal会出现:

2018-10-01T02:34:52.480465Z 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-01T02:34:52.480614Z 0 [System] [MY-013169] [Server] /usr/bin/mysqld (mysqld 8.0.12) initializing of server in progress as process 11041
2018-10-01T02:35:27.030779Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: HA(pmD=en5b*
2018-10-01T02:35:52.397730Z 0 [System] [MY-013170] [Server] /usr/bin/mysqld (mysqld 8.0.12) initializing of server has completed

HA(pmD=en5b*就是临时产生的一个root用户的密码,需要登录进去重新更改才可以操作数据库。

先启动mysql服务:

sudo systemctl start mysqld

然后登录:

mysql -u root -p

更改root临时密码:

ALTER user 'root'@'localhost' IDENTIFIED BY 'new_password';

然后就可以各种命令了。


image.png

你可能感兴趣的:(manjaro gome下安装配置MySQL)