MySQL是一種關(guān)系型數(shù)據(jù)庫(kù)管理系統(tǒng),廣泛應(yīng)用于各種互聯(lián)網(wǎng)應(yīng)用中。以下是MySQL的一些常用命令和操作:
//登錄 mysql -u root -p //創(chuàng)建數(shù)據(jù)庫(kù) CREATE DATABASE database_name; //查詢所有數(shù)據(jù)庫(kù) SHOW DATABASES; //選擇數(shù)據(jù)庫(kù) USE database_name; //創(chuàng)建表 CREATE TABLE table_name ( column1 datatype, column2 datatype, column3 datatype, ..... ); //查詢表結(jié)構(gòu) DESCRIBE table_name; //插入數(shù)據(jù) INSERT INTO table_name (column1, column2, column3, .....) VALUES (value1, value2, value3, .....) //查詢數(shù)據(jù) SELECT column1, column2, column3, .... FROM table_name WHERE condition; //更新數(shù)據(jù) UPDATE table_name SET column1 = value1, column2 = value2, .... WHERE condition; //刪除數(shù)據(jù) DELETE FROM table_name WHERE condition; //刪除表 DROP TABLE table_name; //退出 exit