Search code examples
phpmysqlsqlsqlyog

How to move data from table a (database a) to table b (database b) using sqlyog?


I have 2 table : user (database a) and users (database b)

table user (database a):

id int(5)
username varchar(50)
password varchar(50)
date date
hour time

table user have 100 data

table users (database b):

id int(10)
username varchar(50)
password varchar(50)
created_at timestamp
updated_at timestamp
deleted_at timestamp

table users does not have data

I want to move 100 data from table user (database a) to table users (database b)

whether it can move data from table user (database a) to table users (database b) using sqlyog?

whether using a script?

or is there another way?


Solution

  • If you are using sqlyog, perform below steps :

    1. Open List of tables in database a
    2. Right click on user table and select Copy Table(s) To Different Host/Database
    3. Select database b from the list and click Copy, this will copy user table to database b
    4. Then execute query given in related question: How to copy data from one table to another

    I hope this helps.