Jump to content

Can i use my pc as a database

I'm making a web page for a school project, and i want to make a database, to store the login info and other stuff, but would it be possible to use my pc as one, to not pay for it? My pc doesn't have an IPv6 address, only a so i'm also not sure if that's gonna be a problem. I also know nothing about databases, so what would be a good one to start with?

Link to comment
Share on other sites

Link to post
Share on other sites

Posted (edited)

If you run it locally on your PC, there wouldn't be an easy, safe way to access the database outside your home network. If you have to demonstrate your webpage in class, or make it accessible to your teachers or classmates, that could be a problem.

 

Does the school offer any web hosting to students? If not, the smallest, cheapest web hosting plan you can find would be orders of magnitude more than you need. (Tiny virtual private servers from companies like Linode and DigitalOcean are also options that would work, and so would the free tier of Oracle Cloud, but then you have to set all the hosting and database software up yourself.)

 

If only accessing it yourself at home is no problem, I recommend spinning up a Linux virtual machine in VirtualBox. Install a distribution like Ubuntu Server or Turnkey Linux, which does all the work of setting up the LAMP stack for you (Linux, Apache, MySQL, PHP). That will give you your own generic web server on which you can install anything you want. Just remember it won't be accessible outside your home network.

 

You can also install a database on Windows or set up a web hosting stack yourself, but I avoided those because the assignment is to build a webpage, not a web server.

Edited by Needfuldoer

I sold my soul for ProSupport.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, MiszS said:

I'm making a web page for a school project, and i want to make a database, to store the login info and other stuff, but would it be possible to use my pc as one, to not pay for it? My pc doesn't have an IPv6 address, only a so i'm also not sure if that's gonna be a problem. I also know nothing about databases, so what would be a good one to start with?

MySQL or PostgreSQL are popular and open-source DBMS options. Both are free and have plenty of documentation and tutorials to help you get started. If you're using a web development framework like Django (Python) or Ruby on Rails (Ruby), you may find that these frameworks already have built-in support for specific databases, such as PostgreSQL or SQLite.

 

You'll need to download and install the chosen DBMS on your PC. Follow the instructions provided by the respective DBMS for installation.

 

You can use a tool like XAMPP or WAMP (for Windows) or LAMP (for Linux) to create a local web development environment. These packages include a web server (like Apache), your chosen DBMS, and a scripting language (like PHP).

Link to comment
Share on other sites

Link to post
Share on other sites

You can use SQLite as a database for a simple website / school homework. 

 

SQLite is basically database in a single file , and you only have to enable SQLite extension in PHP to be able to access and do anything with databases. The documentation is available here  : https://www.php.net/manual/en/book.sqlite3.php

 

The syntax is very similar to MySQL.

 

You can store the database file in a folder that can't be accessed by users for example if C:\Projects\Website\www is the folder from where html and php files are served, you could store the database in C:\Projects\Website\Database  and as www is the root folder from your website, people would not be able to download the website by typing the filename in the URL.

 

There's also open source SQLite editors like DB Browser for SQLite : https://sqlitebrowser.org/ or SQLiteStudio  : https://sqlitestudio.pl/

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

12 hours ago, Needfuldoer said:

If you run it locally on your PC, there wouldn't be an easy, safe way to access the database outside your home network. If you have to demonstrate your webpage in class, or make it accessible to your teachers or classmates, that could be a problem.

 

Does the school offer any web hosting to students? If not, the smallest, cheapest web hosting plan you can find would be orders of magnitude more than you need. (Tiny virtual private servers from companies like Linode and DigitalOcean are also options that would work, and so would the free tier of Oracle Cloud, but then you have to set all the hosting and database software up yourself.)

 

If only accessing it yourself at home is no problem, I recommend spinning up a Linux virtual machine in VirtualBox. Install a distribution like Ubuntu Server or Turnkey Linux, which does all the work of setting up the LAMP stack for you (Linux, Apache, MySQL, PHP). That will give you your own generic web server on which you can install anything you want. Just remember it won't be accessible outside your home network.

 

You can also install a database on Windows or set up a web hosting stack yourself, but I avoided those because the assignment is to build a webpage, not a web server.

If i make a database server in a virtual machine, and bring it with me, will it work?

Link to comment
Share on other sites

Link to post
Share on other sites

17 hours ago, MiszS said:

If i make a database server in a virtual machine, and bring it with me, will it work?

Yes if you want to contain the database service in its own virtual environment. Most common use now-a-days is using a docker container. Rather than installing an entire os into a vm and running your database from there

https://earthly.dev/blog/docker-mysql/

 

Or simply signup to a  free webhost provider and run your database from there.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

May not fir your needs, but in the class I am currently doing, we have been using H2 memory database.

 

Benefits it's it's simple, negative is that the data is lost when you restart it.

Will try out another database later.

“Remember to look up at the stars and not down at your feet. Try to make sense of what you see and wonder about what makes the universe exist. Be curious. And however difficult life may seem, there is always something you can do and succeed at. 
It matters that you don't just give up.”

-Stephen Hawking

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×