View Single Post
  #1   IP: 117.95.79.145
Old 2013-04-01, 10:09 PM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default How to import a big database when phpmyadmin can't?

if you have SSH access then you can use the following commands to backup / restore databases
Quote:

mysql -u[Username] -p[Password] [Database Name] < filename.sql - Dump a SQL file into a MySQL database. Note the "<".
Replace "[Username]" with the database username (generally controlpaneluser_databaseuser). Replace "[Password]" with the database password and replace "[Database Name]" with the database name. Finally change "filename.sql" to the correct filename/location.
eq.. to be done from the folder where you want the file to be saved
Quote:
mysql -umyusername -pmypassword mydatabasename < myfilename.sql
Quote:
mysql -u[Username] -p[Password] [Database Name] > filename.sql - Dump a MySQL database to a SQL file. Note the ">".
Replace "[Username]" with the database username (generally controlpaneluser_databaseuser). Replace "[Password]" with the database password and replace "[Database Name]" with the database name. Finally change "filename.sql" to the correct filename/location.
eg.. to be done from the folder where the sql file is
Quote:
mysql -umyusername -pmypassword mydatabasename > myfilename.sql

Last edited by topvip : 2013-04-01 at 10:13 PM
Reply With Quote