mariadb - meetbill/op_practice_book GitHub Wiki

centos7.3 上安装mariadb

centos7.3默认数据库为mariadb

  • yum install mariadb mariadb-server
  • systemctl start mariadb ==> 启动mariadb
  • systemctl enable mariadb ==> 开机自启动
  • mysql_secure_installation ==> 设置 root密码等相关
  • mysql -uroot -p123456 ==> 测试登录!

设置密码是可以如下设置

# mysql_secure_installation
echo -e "\nY\n123456\n123456\nY\nn\nY\nY\n" | mysql_secure_installation


# Y: No [Change the root password]
# y: Yes [Remove anonymous users]
# n: No [Disallow root login remotely]
# Y: Yes [Remove test database and access to it]
# Y: Yes [Reload privilege tables now]