Want to subscribe to topics you're interested in?
Become a Member

MariaDB potential problem while importing database

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by hitman, Feb 8, 2017.

  1. hitman

    hitman Member

    126
    11
    18
    Jul 18, 2014
    Ratings:
    +15
    Local Time:
    8:55 PM
    • CentOS Version: CentOS 7 64bit
    • Centmin Mod Version Installed:123.09beta01
    • Nginx Version Installed: 1.11.9
    • PHP Version Installed: 5.6.30
    • MariaDB MySQL Version Installed: 10.1.21

    well this is a fresh install on a new server and this is kind of weird
    i am transfering 2 sites to the new server and i have set up mysql users and databases and now i am trying to import the databases
    i first "use" the database, and then "source" from the sql file
    http://i.imgur.com/SVxU1hJ.png
    here is the screenshot

    problem is that after the first rows it says "database changed"
    many rows are affected and at the end the imported database does not have the name of the database i used with "use databasename" but it has the name it used to in the old server


    anyone care to explaing what is happening cause i find it a bit strange
    please note that the sites seem to be working fine
     
  2. Jimmy

    Jimmy Well-Known Member

    1,788
    390
    83
    Oct 24, 2015
    East Coast USA
    Ratings:
    +990
    Local Time:
    1:55 PM
    I use this and it works great for me:

    Restore MySQL Database (RESTORE)
    # mysql -u <username> -p <database> < /path/to/<database>_backup_date.sql
     
  3. eva2000

    eva2000 Administrator Staff Member

    55,239
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,833
    Local Time:
    3:55 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    If you want db imported into new db name use myysql import Jimmy's way