GRANT ALL PRIVILEGES ON 数据库名字.* TO用户名@LOCALHOST IDENTIFIED BY ‘密码’ WITH GRANT OPTION;(LOCALHOST:只能从本机访问)
GRANT ALL PRIVILEGES ON 数据库名字.* TO用户名@% IDENTIFIED BY ‘密码’ WITH GRANT OPTION;(%表示可以从任何地方访问)
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON 数据库名字.* TO用户名@LOCALHOST IDENTIFIED BY ‘密码’ WITH GRANT OPTION;(LOCALHOST:只能从本机访问)
GRANT ALL PRIVILEGES ON 数据库名字.* TO用户名@% IDENTIFIED BY ‘密码’ WITH GRANT OPTION;(%表示可以从任何地方访问)
FLUSH PRIVILEGES;