working with mySQL

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:

working with mySQL

Post 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
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: working with mySQL

Post 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
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: working with mySQL

Post 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
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Post Reply