Welcome to Geeklog, Anonymous Monday, May 27 2024 @ 03:19 pm EDT

Geeklog Forums

Needed - Database Level Mass Permissions Change


Status: offline

winnerdk

Forum User
Full Member
Registered: 04/24/05
Posts: 339
Location:Panama City, Republic of Panama
Here's the situation - I've got more than 19,000 published articles in my database. All of them were set with Read and Edit permissions for the Owner, and Read Only permissions for the Group, Members, and Anonymous.

I now need to allow others to edit those articles, so I want to change the Group permissions from Read Only to Read and Edit.

It there a quick and easy way to change all of these permissions for all 19,000+ articles at the database level?

Thanks.

Don
www.panama-guide.com
 Quote

Status: offline

mystral-kk

Site Admin
Admin
Registered: 03/19/06
Posts: 100
Location:Japan
UPDATE gl_stories SET perm_group = 3

"gl_stories" may be different depending on the database table prefix. Anyway, be sure to make a backup of the database before you execute this SQL.
-- mystral-kk, "Every cloud has a silver lining."
 Quote

Status: offline

winnerdk

Forum User
Full Member
Registered: 04/24/05
Posts: 339
Location:Panama City, Republic of Panama

Great. But please do me one more favor. Please explain the walk through on where and how I would make this change. In phpMyAdmin?

I went into phpMyAdmin and looked at the database for gl_stories and the default (for years) was set to 2 for perm_group. I recently changed that to 3 in the configuration. So the vast majority of the database entries have a 2, and just the last few have a 3. I want to set them all to 3 in the database.

But I don't see where the "update" command is located. Can you steer me towards it?

Or, should I not be in phpMyAdmin, and should I be doing this with another program?

I'm not a database wizard, and every time I get in there, I feel like I'm playing with fire...

Don
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
Yes phpMyAdmin.

At the top you have tabs for Browse, Structure, SQL, Search, ...

Click on the SQL tab.

You will now see a spot where you can enter the sql query. You can paste it in there and click on Go.

You should get a message back like X number of records updated.

You could also run a query like this first

SELECT * FROM `gl_stories` WHERE perm_group != 3

which will return all records that do no have the perm_group set to 3 yet (so all the rows that will get updated by the update query).

You do have to be carefuly when updating the database this way so make sure you do back up the database before you do.
One of the Geeklog Core Developers.
 Quote

All times are EDT. The time is now 03:19 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content