Page 1 of 1

working with mySQL

Posted: Sun Aug 07, 2016 6:50 am
by Vegan
So now I have a database open for business, I will move my vegan site later today

so what is the easiest way to revoke and regrant to a specific web site

so can i change the database user passwords

change mysql password

in case of problem

I have saved all of the known working SQL commands so I can cut and paste then into new scripts or web pages depending on what I am up to.

I was wondering, using the database as a revenue source, I wish

Re: working with mySQL

Posted: Sun Aug 07, 2016 1:49 pm
by requinix
You can't grant/revoke a website. You do it with users (the username you use to connect) and hosts (the name/address of the machine you are connecting from).

1. GRANT whatever user@host you need for the new site
2. Put the new site up and make sure it's working
3. Take down the old site
4. DROP whichever user@host it was using

Re: working with mySQL

Posted: Sun Aug 07, 2016 3:21 pm
by Vegan
I have got rid of the old ClearDB I was using, don't need Trump to scream "You're Fired".

So generally to get rid of a unneeded user/database I use the

DROP database; ???

DROP USER 'phpmyadmin'@'localhost';

as for host all the examples were using numerical IP addresses, I use long URLs and was wondering if I can hard code a website for a GRANT

DELETE FROM mysql.user WHERE user='phpmyadmin' and host='localhost';
DELETE FROM mysql.db WHERE user='phpmyadmin' and host='localhost';
FLUSH PRIVILEGES;


keep in mind my server is a pure database there is no apache etc running, all my box does is database

my web server is a the Azure web app host, which is a separate server.

I could up LAMP but that would be way more work than I want to do this month

I am simply wanting to better understand my database so that when its time to do something else.

I can bolt on TB of storage, so compared to the overpriced and underperforming service I was using, this MySQL project has solved a problem