许多网站程序例如WordPress都需要用到数据库。记录一下数据库的各种常用命令。
新建数据库 - create database example_database;
删除数据库 - drop database example_database;
新建用户 - CREATE USER 'example_user' IDENTIFIED BY 'enter_a_password_here';
给用户授权某个数据库所有权限 - GRANT ALL ON example_database.* TO 'example_user' IDENTIFIED BY 'enter_a_password_here';
安装完Mysql 或 MariaDB后,为了设置root密码,首先执行 mysql_secure_installation