Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 3 Years, 8 Months ago Changing the database table prefix'
#1
Solved: 3 Years, 8 Months ago
Hi there,

I would like to change all the default database table prefix' for security purposes and was wondering if there was a easy way to do this without effecting or causing any errors with my forums.


Also, if any of you know any great ways to protect and secure MyBB please tell me, I have used google but I want to see if I can get more tips here since I want my stuff to be secure af.


Regards,
Finn
Reply
#2
Solved: 3 Years, 8 Months ago
assuming that you are using phpMyAdmin, see replies here (esp. last two)

see Protecting Your MyBB Forum | Security Tutorials List
Reply
#3
Solved: 3 Years, 8 Months ago
Cheers m

Will this effect the forums in anyway?
Reply
#4
Solved: 3 Years, 8 Months ago
changing database tables prefix needs changing of the prefix configuration in ~/inc/config.php file
$config['database']['table_prefix'] = 'mybb_';
mybb_ needs to be changed to your new prefix
Reply
#5
Solved: 3 Years, 8 Months ago
If you are using phpmyadmin, you can select all of your tables (at the bottom), click the dropdown and select "Replace table prefix". In the from box, type in mybb, in the to box, type in your new prefix.

You can also do it with an sql query.
SET @database   = "mybb";
SET @old_prefix = "mybb";
SET @new_prefix = "mybb123232";
 
SELECT concat("RENAME TABLE ",TABLE_NAME," TO ",replace(TABLE_NAME, @old_prefix, @new_prefix),';') AS "SQL"
FROM information_schema.TABLES WHERE TABLE_SCHEMA = @database;
You are going to have to have Full Texts on instead of Partial Texts (Under Options above the output then rerun the query). Copy the output and run that and it will rename all tables.

You will also have to change your prefix in inc/config.php
Reply
#6
Solved: 3 Years, 8 Months ago
Cheers Boonie
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)