登錄
mysql -uroot -p
查看數(shù)據(jù)庫
SHOW DATABASES;
創(chuàng)建數(shù)據(jù)庫
CREATE DATABASE bottle;
刪除數(shù)據(jù)庫
DROP DATABASE bottle;
選擇數(shù)據(jù)庫
USE bottle;
查看有哪些用戶
SELECT host,user,password FROM mysql.user;
創(chuàng)建用戶
CREATE USER 'bottle' IDENTIFIED BY 'abcdPassword';
刪除用戶
DROP USER bottle;
為用戶分配權(quán)限
GRANT ALL ON bottle.* TO 'bottle';
flush privileges;
查看表結(jié)構(gòu)
desc t_user;
服務的啟動和停止
service mysqld start
service mysqld stop
service mysqld restart
/etc/inint.d/mysqld start
/etc/inint.d/mysqld stop
/etc/inint.d/mysqld restart