If you want to manage databases without a control panel, you need to use the SSH command line to import .SQL backup files .
To Import MySQL Databases via SSH
- Log in to SSH as the root user.
- To log in to MySQL, type mysql -u username -p, where username is your database username.
- When you see Enter password:, enter your password for that MySQL user.
- Type use database_name; and then press Enter.
- Type SOURCE /path/to/sql/file.sql, and then press Enter.
( Using Putty login to your server
>mkdir foldername
>chmod 777 foldername
Then Login in WinScp
>copy sql file to foldername folder) - Monitor the running import log to check for errors.
- To confirm the data was imported correctly, type show tables; and then press Enter.
- Type select * from table; and then press Enter. Your imported MySQL database tables display.
Import database in Wamp
1. Open Mysql Console(Putty- mysql -u root)
2. mysql>use databasename
Database changed
3. mysql> SET autocommit=0 ; source c:/filename.sql ; COMMIT ;(Putty: SET autocommit=0 ; source /foldername/filename.sql ; COMMIT ;
0 comments:
Post a Comment