PHP v BASH

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

PHP v BASH

Post by Vegan »

I am now operating a Linux VM so I am now working with BASH in addition to PHP


sudu apt-get update
sudo apt-get upgrade
sudo apt-get install mysql-server

need a better database appliance
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: PHP v BASH

Post by Celauran »

Is there a question in there somewhere?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: PHP v BASH

Post by Christopher »

Probably just more signature link spamming.
(#10850)
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: PHP v BASH

Post by Vegan »

i was wondering if PHP can handle most of the MySQL work, not to sure how to get it linked up

some tasks like

mysqlcheck -u root -p --check --databases dbname
mysqlcheck -u root -p --optimize --databases dbname
mysqlcheck -u root -p --analyze --databases dbname


are shell but I would like to be able to call such tools from a web page form

other thinks I thought about are

mysql> GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'%' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;

so I was wondering how to generate a new database fast through a web form

i was wanting to use per user accounts so the databases are stored with user folder etc

so adduser needs to be called etc
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: PHP v BASH

Post by Celauran »

Sounds like maybe you want something like Adminer or phpMyAdmin. Why through a web page? Something like Sequel Pro or Heidi SQL via SSH tunnel will provide a considerably better experience.
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: PHP v BASH

Post by Vegan »

I have used phoMyAdmin with a 3rd party product, I am trying my hand at rolling my own

sudo lshw -class disk

which found the 50GB i created, so I partitioned it GPT with fdisk, formatted ext4 unless there is something better for mysql

not sure if I can stuff the storage under the default MySQL or should I edit the config file?

suggestions?
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: PHP v BASH

Post by Celauran »

Vegan wrote:I have used phoMyAdmin with a 3rd party product, I am trying my hand at rolling my own
Why?
Vegan wrote:not sure if I can stuff the storage under the default MySQL or should I edit the config file?
Not clear what you mean here. It may vary some by distro, but it's usually under /var/lib/mysql. Does that not work for your setup?
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: PHP v BASH

Post by Vegan »

I am using Ubunto 16.04 so whatever that flavor is using, I was not sure how to make the mount persistent

/sql is where i wanted to stuff the database for want of a location

/etc/fstab seems to be present, wanted the mount to be up when rebooted so the database is up right away

sudo mkdir /sql
sudo mount -t ext4 /dev/sdc /sql
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: PHP v BASH

Post by Celauran »

You should be able to just specify new datadir and socket values in your my.cnf
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: PHP v BASH

Post by Vegan »

for some reason there are no datadir or socket values at all in that file, adding them spawns an error

wonder what gives?

I have /sql as my storage, there is a blue mysql file there

so that seems to be ok
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Post Reply