Command line sql database setup.


This is just enough to hang yourself with.

#==========================================================================
# pseudo-code or generic instructions to set up a lamp web server apps on
# Debian based lamp servers you will have to modify it to your needs.
# this is assuming a lamp server is already properly set up.
# Setup is another discussion.
# all rights unreserved by the unknown admin
#**************************************************************************
# Get file from internet chances are you visited the sit and have the
# location of the file to be downloaded.
# use Curl for a directory or wget for a single file. use the man pages for
# additional instructions
wget $website/$subdirectory/$filename
# Extract the file in the home directory (not the destination filename for use
# in the next step.
tar zxvf filename.tar.gz
# move the directory into the web document root for use with http
# webappdirectory will become webappname
sudo mv webappdirectory /var/www/
# if you do not have this directory then a server is not setup
# to set up lamp server:
# sudo aptitude install lamp-server
# or
# sudo apt-get update
# sudo apt-get install lamp-server
#***************************************************************************
# set up your database and create user to manage it.
# Courtesy of Linux Reality home server series by Chess Grffin
mysql>
# When entering commands at the MySQL prompt, you must must have a
# semicolon at the end of each line before pressing Enter.
# To create a database, do the following at the MySQL prompt:
mysql> CREATE DATABASE wordpress;
# This will create a database called “wordpress.” The next step is to
# create a separate non-root MySQL user with a password and to grant all
# privileges to that non-root user. This can be done all in one step as
# follows:
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO ‘bloguser’@’localhost’ IDENTIFIED BY ‘abcd';
# (That is all on one line.)
# Then, do the following:
mysql> FLUSH PRIVILEGES;
mysql> EXIT;
# You will then be back at the regular command prompt.
#*******************************************************************************
# Set permissions for web app directory. (this will vary from app to app)
# read the instructions for the webapp to be sure
# see http://www.draac.com/chmodchart.html for more details
sudo chown -R www-data:www-data /var/www/$webappname
sudo chmod -R 755 /var/www/$webappname
#*******************************************************************************
# test web application
# http://localhost/webappname
# apps may make you go to a special directory first for an install process
links2 http://localhost/webappname
# i.e http://localhost/webappname/install or http://localhost/webappname/config
# io finito
#================================================================

Comments

Popular posts from this blog

Guiless?

MSOffice vs Libreoffice

Raspberry pi zero.