MyBB Community Forums

Full Version: Tutorial - Database tips -
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Few tips how to make your database stable for use:

Optimize your Database:

To perform the optimization, log in to your phpMyAdmin and select the database whose tables you wish to optimize.

A list with all the database's tables will appear. Tick the tables you wish to optimize, or simply click [Check All] to select all tables.

From the [With selected:] drop-down menu choose Optimize table. This will execute the OPTIMIZE TABLE SQL query on the selected tables and they will be updated and optimized.


Table prefixes:

Sometimes when you are moving your database on another host etc, it happens database generate new tables example:

Your table prefix: mybb3_
New tables: mybb5_

It's hard to see it, and also that can make forum slower so check for that.

Security Guidelines:

-Do not ever give anyone (except MySQL root accounts) access to the user table in the mysql database!

-Do not store any plaintext passwords in your database

-Use complex password for your Cpanel do not use something like "mybbjohn", use more numbers etc. More about complex passwords.

-Carefully watch from where are you downloading plugin, maybe some of them have are vulnerable to SQL injection so hacker can get access to your database.

Also read more threads about MyBB Security such as:

http://community.mybb.com/thread-44977.html
http://community.mybb.com/thread-9991.html

Hosting related:

Watch out which host you choose. On my own experience i changed 6 hosts, and 90% had server security problems.
Don't save your money on cheap hosting's, better pay more but to have good and much secured hosting. If you want to start the proiject don't even try free hosting.

Database Backups:

Do your database backups every day (my recommend). You will never know what will happend, losing some table, host shutdown, some kidy hacker screwed it all.
It's free to make database backups nothing costs you.

I'll keep this updated, JovanJ.
Quote:-Do not ever give anyone (except MySQL root accounts) access to the user table in the mysql database!

I see multiple issues with this:

- you will be using your MySQL root user for the DB. This means that if there is something on the server is exploited (and allows config.php's reading) (doesn't have to be mybb), then they will know a root password and can then have access to any DB on the server. Potentially before the password gets changed.

- having a different non-root account for each DB is better. This way, if one password gets found, the other DBs will likely be safe.

- root shouldn't be used for DB management in most cases, again, specialized users are better.
Yeah i saw them too, they just need to follow that line which you quoted and that's it Smile