MyBB Community Forums

Full Version: Problem with database tables
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello, i wanna move from vps to another one.
after database backup , everything was fine.
i copy all my files to the new vps.
then when i tired to upload the database many time to the new vps, always failed


message from support team :
root@ns [/home/haifa/public_html/mysqldumper/work/backup]# mysql -o haifa_mybb < haifa_mybb_2011_07_16_22_22.sql ERROR 1146 (42S02) at line 1350293: Table 'haifa_mybb.mybb_threadviews' doesn't exist


what can i do ?
Make Sure your database name in old host and new host are same, and your table prefix has to be same.

if they are not same, you need to edit it in your .sql file

More over in .sql backup, Command for table creation, it should be=>
CREATE TABLE if not Exist and than blah blah...

and not
CREATE TABLE blah_users (...
yes both are same tabase name
also same username and passowrd

[Image: thumb.php?id=A5A6_4E2370F2]
(2011-07-17, 11:33 PM)queenhaifa Wrote: [ -> ]yes both are same tabase name
also same username and passowrd

I will tell you the simple way... If your old files are clean, than, Just Upload your Old files to your htdocs folder, and without creating any table just import your database.

Command for database import, Open your MYSQL console.
mysql> CREATE DATABASE your_old_database_name;
Query ok , 0 rows Affected

mysql>use your_old_database_name;
Query Ok, 0 rows affected

mysql>source your_sql_file
.....and this will upload your file, and your site will be up as this gets finished
i know how to import , and move files, its not my first time
but its my first time i fix this probblem , and i can't test anytthing without asking , i don't know how to work on phpmyadmin
only if you teach me , what i should do excatly

check this
[Image: thumb.php?id=A470_4E2372FF]
Try repairing your table and than importing again.
i tried to repair it :

Table Op Msg_type Msg_text
haifa_mybb.mybb_threadviews repair Error Incorrect file format 'mybb_threadviews'
haifa_mybb.mybb_threadviews repair error Corrupt
If you are in phpmyadmin, and if you have already created blank tables than Do this:-

1). Export your new database which is blank
2). Drop all your tables.
3). Import your sql files.
4). if this is success, than good, your forum is up.
If thats not success, than first import back new blank database.

and than check mybb_threadviews, break in few parts and than import one by one, this will help you in finding the point from where you gettin the error.

Note:- repair table is vital option here, so, do it everytime.