处理没有 mysql 的主机

发布于 2024-10-15 23:52:48 字数 193 浏览 3 评论 0 原文

我正在与一个好的网络主机打交道,但问题是他们将 mysql 限制为 1 个 25MB 的数据库。

问题是我需要更多,但目前无法支付更多费用。

是否有任何解决方案,例如 .dat 文件或具有基本管理功能的任何类型的平面文件数据库。

我不会很大,但它必须有很多数据库,因为我必须在该托管计划上运行多个网站。

谢谢

I am dealing with a good web host but the problem is that they limit mysql to 1 database of 25MB

The problem is that I need more but can't afford to pay more for the moment.

Is there any solution like a .dat file or any type of flat file database with basic management.

I'ts not going to be very big but it has to be many databases because I have to run more than one site on that hosting plan.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

流心雨 2024-10-22 23:52:48

SQLite

<?php
if ($db = sqlite_open('my.db', 0666, $sqliteerror)) { 
    sqlite_query($db, 'CREATE TABLE foo (bar varchar(10))');
    sqlite_query($db, "INSERT INTO foo VALUES ('fnord')");
    $result = sqlite_query($db, 'SELECT bar FROM foo');
    var_dump(sqlite_fetch_array($result)); 
} else {
    die($sqliteerror);
}
?>

There's SQLite

<?php
if ($db = sqlite_open('my.db', 0666, $sqliteerror)) { 
    sqlite_query($db, 'CREATE TABLE foo (bar varchar(10))');
    sqlite_query($db, "INSERT INTO foo VALUES ('fnord')");
    $result = sqlite_query($db, 'SELECT bar FROM foo');
    var_dump(sqlite_fetch_array($result)); 
} else {
    die($sqliteerror);
}
?>
千年*琉璃梦 2024-10-22 23:52:48

我认为您可能正在寻找的是 SQLite...

I think what you might be looking for is SQLite...

咽泪装欢 2024-10-22 23:52:48

正如其他人指出的那样,尽管您需要了解限制,但 SQLite 是一个考虑因素:

http://www.sqlite.org/limits.html sqlite.org/limits.html

如果您使用的是 Windows Server 系统(不太可能,但有可能),您可以使用 Access,并使用 ODBC 连接:

http://www.w3schools.com/PHP/php_db_odbc.asp

另外,也许是 Firebird:

http://www.firebirdsql.org/

不过,在深入了解之前请注意一些事项。

  1. 文件锁定 - 同时拥有多个用户可以锁定请求响应,直到锁定被清除
  2. 文件访问 - 如果您将文件放入 HTML 目录中,则需要采取防止其他人下载您的数据库的预防措施;最好让它远离你的公共路径
  3. 优化 - MySQL 和 PostgreSQL 将会工作得更好;这些其他选项都无法优雅地扩展,这引出了我的最后一个注释...
  4. 撤销您所做的事情 - 当您的网站足够大以至于需要更好的数据库系统时,您可能会发现自己需要重做一堆代码或找到一种方法将数据移植到新的设置中,

认真考虑是否可以将它们全部存储在一起,或者也许寻找另一个可以帮助使其更便宜的提供商。例如,我喜欢 Dreamhost(5 个数据库每月 8.95 美元),尽管我最喜欢的提供商是 MediaTemple,我用了好几年了,每月费用约为 22 美元。还有其他类似的竞争者,甚至是亚马逊网络服务。

As others note, SQLite is a consideration, although you will want to be aware of limitations:

http://www.sqlite.org/limits.html

If you are on a Windows Server system (not likely, but possible), you can use Access, and connect with ODBC:

http://www.w3schools.com/PHP/php_db_odbc.asp

Also, maybe Firebird:

http://www.firebirdsql.org/

However, just note some things before you get too far into it.

  1. File locking - having multiple users at once can lock out request responses until the locks are cleared
  2. File access - if you put a file within your HTML directory, you will need to take precautions against allowing other people to download you database; best to keep it off your public path altogether
  3. Optimization - MySQL and PostgreSQL are going to work much better; none of these other options are going to scale gracefully, which leads me to my last note...
  4. Undoing what you've wrought - When you get your sites large enough to require a better database system, you could find yourself needing to redo a bunch of code or finding a way to port your data to a new setup

Seriously consider whether you can store it all together, or maybe look into another provider which can help make it more affordable. For instance, I've liked Dreamhost ($8.95/month for 5 databases), although my favorite provider is MediaTemple, who I used for several years and cost about $22/month. There are others out there that are similarly competitive, even Amazon Web Services.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文