• Quick note - the problem with Youtube videos not embedding on the forum appears to have been fixed, thanks to ZiprHead. If you do still see problems let me know.

mysql

nimzov

Unregistered
Joined
Apr 12, 2004
Messages
954
I have tried to import a .sql file into a musql database using phpmyadmin
I get all sort of timeouts. So I uploaded via ftp the .sql file on the server.

Now my question is : how do I import the .sql file into the database now that it is on the server. The only file I can import with phpmyadmin seems to be those that are local on my computer ?

I don't know what I am missing.

Thanks
 
Type the following:
Code:
mysql -u [i]username[/i] -p [i]database[/i] < [i]myfile.sql[/i]

Where username, database, and myfile.sql are your username, database and .sql file.
It'll prompt you for your password.

I'm assuming you're under some kind of *nix OS. If it's Windows, you'll probably have to type the full path of your mysql.exe file.

ETA: I'm also assuming you have ssh access to your server. Under Windows, it would be called 'putty'.
 
Last edited:
It is linux but unfortunately I have no ssh access.

My only tool is phpmyadmin to access the database.
 
What size is the .sql file? I'm guessing you get timeouts simply because it's too big and PHP by default (and apache as well, if i'm not mistaken) maxes out at 2MB uploads. If you've uploaded it by FTP you should probably just mail the support of whomever you rent your server/space from and ask them to import it for you.
 
What size is the .sql file? I'm guessing you get timeouts simply because it's too big and PHP by default (and apache as well, if i'm not mistaken) maxes out at 2MB uploads. If you've uploaded it by FTP you should probably just mail the support of whomever you rent your server/space from and ask them to import it for you.

depends on the apche settings, but yeah if it hasn't been changed it's relatively low. The issue is probably not apache, but a php timeout. Ie. php is processing X (involving pulling up the file, parsing into database) and it exceeds a 5minute php timeout. That is also a setting that needs to be checks, however I fear access to php.ini is not available by the description of the OP.

I would also suggest breaking up the file. Perhaps by table?





ETA. Oh you said the php thing. where's my coffee, damnit?


ETA2. This is why phpmyadmin sucks balls. If you can request shell access, please do so.
 
The file is 474 MB. It is a very big vbulletin forum that I want to migrate.

I cannot get a shell access with this account. But as suggested I will
ask support to import the file for me.

Thanks
 
Last edited:
Do you control phpMyAdmin? If so, set 'UploadDir' to the absolute path where you've uploaded the SQL file via FTP, and then you'll be given the option of importing the local file.
 
Do you control phpMyAdmin? If so, set 'UploadDir' to the absolute path where you've uploaded the SQL file via FTP, and then you'll be given the option of importing the local file.
I do not control much. The only change I can make is to font size and to color theme. :boxedin:

Support have imported the file for me but it is very inconvenient to have to ask them everytime I need to import a file.

Thanks to everyone who commented.
 
Last edited:
I would do a re-xport from Vbulletin and do it per groups of tables instead of one big sql dump (this also can lead to corrupted data as well).

also so to save space in Vbulletin is to make sure you set your image upload so that it saves to a folder than within the database.
 
My old forum is now close. I cannot re-export the data. All I have left is
this .sql file.

I have another problem, I get this error when I try to install/upgrade a new vBulletin forum:

MySQL Error : Illegal mix of collations (latin1_general_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '='Error Number : 1267

I have many different collation in the dump file.

I wonder if I can simply edit the sql file with a text editor and make all
the collation the same. Something like UTF-8 ?

nimzo
 
You can usually change the collation in phpMyAdmin itself. Click the "operations" tab.

Be aware that sometimes switching to UTF-8 will result in older posts showing strange characters. There are filters for Wordpress that will fix this, but not sure about vBulletin.
 
I would install MySQL Administrator locally on your home box. Then I would configure MySQLMyAdmin to accept connections from your host. Then I would simply use the MySQL Administrator to import the SQL file.
In my experience, it is far better to use MySQL Query Browser and Administrator on your local box then messing around with the web interface of MySQLMyAdmin.
 
You can usually change the collation in phpMyAdmin itself. Click the "operations" tab.
Unfortunately it will not change the collation of the "existing" tables. It will only set the new collation for the "future" tables.

@portlandatheist

I will try your suggestion. Thanks.

nimzo
 
Last edited:
Unfortunately it will not change the collation of the "existing" tables. It will only set the new collation for the "future" tables.

@portlandatheist

I will try your suggestion. Thanks.

nimzo
In case remote admin doesn't work out, put another support ticket in (no shell access really is a pain) and ask them to do something like

Code:
 sed -i 's/latin1_general_ci/utf8_general_ci/' dumpfile.sql
Replaces every instance of latin1_general_ci with utf8_general_ci in your sql file.
 

Back
Top Bottom