采用matlab访问数据库 matlab 2018b(2020a也可)
%% 采用matlab访问数据库
conn = database('labmysqltraincourse','root','12345','Vendor','MYSQL','Server','localhost','PortNumber',3306);
data = fetch(conn,['SELECT * ' ...
'FROM labmysqltraincourse.student']);
close(conn)
clear conn
%% 采用matlab访问数据库
conn = database('centralsystem','root','pkujrk','Vendor','MYSQL','Server','192.168.0.4','PortNumber',3306);
data = fetch(conn,['SELECT de FROM centralsystem.experimentdata where datanum = ''d00003'' and pid = 11']);
close(conn);
clear conn;
两个双引号,相当于一个单引号