mysql常用命令

  1. 使用mysql
 mysql -u root -p
  1. 查看所有用戶
select user,host from mysql.user;

3.查看所有數據庫

show databases;

4.創建數據庫

create database wp;

5.刪除數據庫

drop database wp;

6.創建用戶

create user '${userName}'@'localhost' identified by '${password}';

5.刪除用戶

delete from mysql.user Where user='${userName}';

6.用戶授權

grant all privileges on ${databaseName}.* to '${userName}'@'localhost';

7.退出mysql命令行

exit;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章