所有操作均在bash终端中进行
使用Ctrl + Alt + T打开
sudo apt install mysql-server
sudo service mysql status
sudo service mysql start
sudo service mysql stop
mysql -h host -u user -p
quit;
exit;
sql语句不区分大小写
mysql> create database name;
mysql> use database_name;
mysql> create table stu_info (name varchar(20), stu_number varchar(20), sex char(1), class varchar(5), qq varchar(20));
CREATE TABLE `app_studentinfo` (`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, `s_id` integer NOT NULL, `s_name` varchar(20) NOT NULL, `s_sex` bool NOT NULL, `s_class` varchar(20) NOT NULL, `s_qq` bigint NOT NULL);
mysql> load data local infile '/path/xx.txt' into table table_name lines terminated by '\r\n';
mysql> insert into stu_info values('devecor', '2020123456', '0', 'A专业1班', '123456789');
mysql> select what_to_select
-> from which_table
-> where conditions_to_satisfy;
mysql> select * from stu_info;
mysql> select * from stu_info where name = 'devecor';
mysql> select * from stu_info where name = 'devecor2' and sex='1';
mysql> select * from stu_info where name = 'devecor2' or sex='1';
mysql> select name stu_info;
mysql> select name, class form stu_info;
select * from stu_info order by stu_number;
mysql> delete from stu_info;
mysql> delete from stu_info where name = 'devecor';
mysql> update stu_info set name = 'devecor0' where name = 'devecor';
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。