mysql資料庫和使用者建立

2021-06-21 09:12:34 字數 655 閱讀 9437



1. 建立資料庫:

create database test;

2.建立使用者:

-----------任何終端都可以連線

grant select,insert,update,delete on test.* to user@"%" identified by "123456";

------------只讓某個位址段連線

grant select,insert,update,delete on test.* to user@"172.44.16.*" identified by "123456";

------------只讓本地連線

grant select,insert,update,delete on test.* to user@"localhost" identified by "123456";

-----------賦給使用者全部的許可權在某個資料庫

grant all on test.* to user@"localhost" identified by "123456";

-----------賦給使用者全部的資料庫許可權

grant all on *.* to user@"localhost" identified by "123456";

資料庫建立完畢!

mysql 建立資料庫和使用者

1 用管理員賬號登陸mysql 2 建立資料庫 create database db01 3 建立使用者 create user user01 localhost identified by password1 user01只能本地訪問 create user user02 identified b...

mysql建立資料庫,建立使用者

建立資料庫 create database test use test 建立使用者 create user test identified by test 給使用者賦權 grant all on test.to test 建立資料庫 命令 create database databasename 例...

Mysql建立資料庫使用者

通常情況下我們在編寫 的過程中 也就是在開發過程中 一直使用的是我們本地的mysql,而且使用者都是root使用者,最高許可權的使用者,但是我們如果在公司上班的時候,公司的領導不會讓你擁有root許可權,這樣存在風險.這就需要建立普通的使用者.開啟自己的cmd,輸入mysql u root p 輸入...