- Connect to mysql database server
$ mysql -uusername -ppassword - Check database exists are not
$ show databases; - If not create the same
mysql>create database mydb;
note: mydb is database name(Give your own). - Check again for the database follow step 2.
- exit
- Import data to mydb(your own) database
$ mysql -uusername -ppassword mydb < bag.sql
note: your bag.sql is in the current directory from where you are executing the above command - Check for imported data.
Symbol '$' is shell prompt
Export database mysql:
# mysqldump -u root -ppassword database_name > File.sql
Dan untuk mengimportnya:
# mysql -u root -ppassword database_name < File.sql
Perintah yang cukup sederhana bukan?
No comments:
Post a Comment