Coder Social home page Coder Social logo

manicmike66 / mysqlpatterndb Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 476 KB

Paper sewing pattern collectors web database set up for your own PC (localhost) but easily extended to a network, with some common sense modifications.

PHP 100.00%
sewing patterns paper

mysqlpatterndb's Introduction

#mysqlpatternDB There are two parts to having a web database: The web part and the database part.

I assume you only want to run this on your own computer (the localhost) and that you're installing on Linux. If you aren't, you'll have to modify some of the instructions to suit. E.g. if you're on Windows, install WAMP server, Mac is MAMP server. The scripts will probably work without a problem on these but file paths on Windows will be different.

When you're finished installing it, you'll open http://localhost/index.php to begin using it. If you aren't, read this whole file before installing it. You will need to change or set certain passwords.

The components:

You need to have installed (and working):

  • apache2
  • libapache2-mod-php7.2
  • mysql-server
  • php-mysqli

sudo su - # become root until it's all installed apt install apache2 libapache2-mod-php7.2 mysql-server php-mysqli will get them on a debian based system

If you've just installed mysql it will have a randomly generated root password set, so you can install our blank database by copy-pasting this code (from the directory containing patterns-blank.sql) as the computer's root user.

cat patterns-blank.sql|mysql -u root --password='cat /etc/mysql/debian.cnf |grep password|head -1|awk '{print $3}''

If you already have mysql installed, use: cat patterns-blank.sql|mysql -u root --password=''

This will create the database then grant access to user pattern@localhost with the password 'p@tt3rn'.

If you're going to use this on a networked computer, change the password from this default, since it's public and extremely easily guessed. If you change the database credentials, you also need to change the file includes/creds.ini

The php scripts all need to be copied to a web directory and it's easiest if this is the root directory. Change ownership of the files to the owner of the apache service (on Ubuntu and mint this is www-data, so if you'd issue this command (as root):

cp -r html/* /var/www/html && chown -R www-data /var/www/html The first command copies the files, the second changes ownership to the web server.

The images will be encoded and stored on the database. If you don't like this, feel free to customise the code to store them on your own filesystem. An advantage of storing on a database is that file backups are done with the database backup. An advantage of storing them on the filesystem is that you can rewrite the index to look for .jpg and upload all of your images at once simply by putting a copy into the appropriate directory. I have written another version of this project which uses Postgres and the filesystem approach (mainly because PSQL has a really hard time displaying images stored in the database) and will make this available as a separate project on github when it's finished.

mysqlpatterndb's People

Contributors

manicmike66 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.