参考 https://wiki.archlinux.org/index.php/MySQL

初始化

Arch Linux

mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mariadb
systemctl start mariadb.service
mysqladmin -u root password 'new-password'

初始化后即可进入命令行

mysql -u root -p

用户管理

create user username@localhost identified by 'new-password';    # 创建用户
grant all on *.* to mytest@localhost;                           # 授予数据库权限