📄 console.dpr
字号:
program console;
{$APPTYPE CONSOLE}
{$DEFINE CONSOLEAPP}
uses
SysUtils,
Classes,
MySQLServer;
var
s: TMySQLServer;
i: integer;
sl:TStringList;
begin
// This is a simple console app listing your databases on a server,
// just enter your host, username and password and run.
// The TMySQLServer uses direct TCP/IP access to your mysql server by default,
// so it doesn't need any mysql client libraries or additional dlls.
// When you see the list (if you have permission to get that from the server)
// just press Enter to return to the IDE.
// In the same way you can use the TMySQLServer and TMySQLDatasets in CGI/ISAPI apps, etc
// Another useful feature of TMySQLServer is the Dataset and DatasetFrom methods,
// see your MyComponents helpfile for more information
s := TMySQLServer.Create(nil);
s.Host := 'your_mysql_server_IP_or_host';
s.Port := 3306; // Your TCP/IP port used by your mysql server
s.UserName := 'your_mysql_username';
s.Password := 'your_mysql_password';
s.Open;
sl := TStringList.Create;
s.GetDatabaseNames(sl);
for i:=0 to Pred(sl.Count) do WriteLn(sl[i]);
Readln;
s.Close;
s.Free
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -