网站环境不同,不同程序有不同的数据库配置位置以discuz为例,其他的随机应变:
Discuz论坛的数据库在程序中有设置文件对应查询账号密码,目录位置:
/config/config_globalphp
/uc_server/data/configincphp
/config/config_ucenterphp
文件都含有Discuz论坛数据库的登录账号密码信息,可以参考查询数据库信息。
网站本身的数据库是和程序分开的,大部分主机都是储存在两个空间。小型虚拟主机,没有权限查看数据库文件,但是会提供在线管理的工具,一般在空间后台有提供链接。
云主机,快云VPS,云服务器,以及独立主机,都有远程服务器管理权限的,直接登录远程,就可以查看数据库位置。
目前的情况看,快云VPS都自带云数据库,也有管理平台,可以后台直接打开,登录管理数据库。
有完整源代码,附上数据库部分代码参考:
CREATE TABLE [dbo][JudgeProblem](
[ID] [int] IDENTITY(1,1) NOT NULL,
[CourseID] [int] NOT NULL,
[Title] [varchar](1000) NOT NULL,
[Answer] [bit] NOT NULL,
CONSTRAINT [PK_JudgeProblem] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo][MultiProblem](
[ID] [int] IDENTITY(1,1) NOT NULL,
[CourseID] [int] NOT NULL,
[Title] [varchar](1000) NOT NULL,
[AnswerA] [varchar](500) NOT NULL,
[AnswerB] [varchar](500) NOT NULL,
[AnswerC] [varchar](500) NOT NULL,
[AnswerD] [varchar](500) NOT NULL,
[Answer] [varchar](50) NOT NULL,
CONSTRAINT [PK_MultiProblem] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo][Student](
[ID] [varchar](50) NOT NULL,
[Name] [varchar](20) NULL,
[PWD] [varchar](20) NULL,
[Sex] [varchar](2) NULL,
[JoinTime] [varchar](20) NULL,
[Question] [varchar](50) NULL,
[Answer] [varchar](50) NULL,
[profession] [varchar](50) NULL,
CONSTRAINT [PK_tb_Student] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo][Score](
[ID] [int] IDENTITY(1,1) NOT NULL,
[UserID] [varchar](20) NOT NULL,
[PaperID] [int] NOT NULL,
[Score] [int] NOT NULL,
[ExamTime] [datetime] NOT NULL CONSTRAINT [DF_Score_ExamTime] DEFAULT (getdate()),
CONSTRAINT [PK_Score] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo][Course](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](200) NOT NULL,
PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
以上就是关于如何找到网站源码中的数据库全部的内容,包括:如何找到网站源码中的数据库、基于ASP.NET在线考试系统开发实例源码,SQL Server 2008数据库、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)