create a first user and a first database for him in mysql

第一个username/password应该是root和root的密码.其余的应该是新建用户的用户名和密码.

mysql --user=<username> --password=<password>

create user <username> identified by '<passpord>'
\g

create database <dbname> charater set utf8
\g

grant all privileges on <dbname>.* to <username>@localhost identified by '<password>'
\g

\q

原文地址:https://www.cnblogs.com/deerchao/p/1210992.html