Import my Database in Cpanel

Behrooz_Ice

Member
Apr 3, 2004
8
0
151
IRan
hello dear reader
We have Tooken a backup from our site via Plesk Contorl panel , and now the database.sql is about 250mb , how can we imoprt this huge data base via cpanel into our new host for the vbulliten board. thank you
Regards
Behrooz Kamalian
 

getnetworks

Member
Jun 24, 2003
13
0
151
If it's a true MySQL dump file and not some Plesk proprietary file, you'd be best to upload it to the server and use the mysql CLI binaries to import it. Just create the DB using the cPanel first so it already exists such that you can then import it. Trying to the phpMyAdmin on a file that size can pose problems.

FYI, neither of these options (with the exception of creating the DB) really involve cPanel.
 

kris1351

Well-Known Member
Apr 18, 2003
963
0
166
Lewisville, Tx
phpMyAdmin will actually reject a sql dump that big. You will have to use the msyq/mysqladmin commands via shell to get it imported. Create the DB on the new server as stated above and import it.
 

Behrooz_Ice

Member
Apr 3, 2004
8
0
151
IRan
Thx for your help , our previous host was linux and it uses mysql and also our current host is linux , our new host is on our dedicated server and we have a shell access , but the problem is that we dont know how to import our sql database via the shell , would you please help us how to import the database via our shell account?
Best Regards
Behrooz kamalian
 

bamasbest

Well-Known Member
Jan 10, 2004
531
0
166
First, create the database(s) via cpanel,

then

shell> mysql --user=username --password database < /path/to/dumpfile.sql

substitute your username, the databasename and path/to... to the correct values.
 

Behrooz_Ice

Member
Apr 3, 2004
8
0
151
IRan
[email protected] [/home/ashiyan3]# mysql -u ashiyan3_vb -p 258369963 <ashiyane.sql.gz
Enter password:
ERROR 1044: Access denied for user: '[email protected]' to database '258369963'

dear sir , after typing this command in the terminal we get this error message , please tell us why does this error occures and if you mind helping us to import our database in our new account.
Regards , bye
 

bamasbest

Well-Known Member
Jan 10, 2004
531
0
166
Originally posted by Behrooz_Ice
[email protected] [/home/ashiyan3]# mysql -u ashiyan3_vb -p 258369963 <ashiyane.sql.gz
Enter password:
ERROR 1044: Access denied for user: '[email protected]' to database '258369963'

dear sir , after typing this command in the terminal we get this error message , please tell us why does this error occures and if you mind helping us to import our database in our new account.
Regards , bye
I see,

Firstly, you may want to gunzip the compressed .sql file.

Secondly,

look at the respective commands

mysql> --user=ashiyan3_vb (OK, I assume)
-p <leave this blank and respond when command line asks for password (more secure)>

database <substitute the actual database, should be something like ashiyan3_<dbname>


then, the pathe to the sql file (i.e. /home/ashiyan3/public_html/dbfile.sql

See what happens now:)
 

Behrooz_Ice

Member
Apr 3, 2004
8
0
151
IRan
ok dear , thx for your help , but this time this error occures:

=============================

[email protected] [/home/ashiyan3]# mysql -u ashiyan3_vb -p -D ashiyan3_vb< ashiyane.sql
Enter password:
ERROR 1064 at line 273385: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '<br />
Fatal error: Maximum execution time of 30 second

==============================

Sorry for this amount of questions i ask but making our site up is very important for us.
Regards , bye