創建一個用戶:
create user 'oukele'@'%' identified by 'oukele';
提示下面所列出的信息的話,得刷新一下權限表
The MySQL server is running with the --skip-grant-tables option so it cannot execute this st...
步驟如下:
擴展學習
mysql 新建用戶並賦予遠程訪問權限
[root@demo /]# mysql -u root -p #登錄服務器數據庫
Enter password:123xxx
#1.創建一個新用戶 testuser 密碼為 testuserpass
CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'testuserpass';
#2.創建數據庫testDB
create database testDB;
#3.執行命令為testuser用戶添加使用testDB權限
grant all privileges on testDB.* to testuser@localhost identified by 'testuserpass';
#4.執行命令,為testuser用戶添加遠程訪問權限
GRANT ALL PRIVILEGES ON testDB.* TO 'testuser'@'%' IDENTIFIED BY 'testuserpass' WITH GRANT OPTION;
#5.刷新權限表
flush privileges;
參考的文章: