MySQL數(shù)據(jù)庫(kù)8.0.11版創(chuàng)建用戶及數(shù)據(jù)庫(kù)方法
1.使用root用戶進(jìn)入mysql數(shù)據(jù)庫(kù).
2.創(chuàng)建數(shù)據(jù)庫(kù),將databasename換成數(shù)據(jù)庫(kù)名稱.
CREATE DATABASE `databasename` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
3.創(chuàng)建用戶 username為用戶名,password為密碼.
CREATE USER username IDENTIFIED BY 'password';
4.授權(quán)username用戶在databasename上的權(quán)限,all代表所有,可分為INSERT,SELECT,UPDATE等權(quán)限,%代表任何ip都可訪問該數(shù)據(jù)庫(kù).
grant all privileges on databasename.* to 'username'@'%';
5.刷新
FLUSH PRIVILEGES;