1 | ## Fedora 24 ## |
安装MySQL。
1 | dnf install -y mysql-community-server |
启动MySQL。
1 | systemctl start mysqld.service ## use restart after update |
登陆时会提示如下错误:ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)获取随机密码。
1 | grep 'A temporary password is generated for root@localhost' /var/log/mysqld.log |tail -1 |
重新设置MySQL密码,密码要求包含大小写和数字以及特殊字符,不符合安全策略的(Your password does not satisfy the current policy requirements)密码无法设置成功。
1 | SET PASSWORD FOR 'root'@'localhost' = PASSWORD('$jxqMySQL123456'); |
數據庫操作
創建數據庫。
1 | #列出數據庫 |