Go to the SQL file, open it up with notepad ++
There is likely code in there defaulting the update to be on the database the sql came from.
When you save the table or set of tables (at least from heidisql) it notates the database it came from and writes it in the file... so now when you source the file, it comes up with error at row #### already exists etc.
Change it to the new database name.
Quote:
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.1.13-MariaDB - mariadb.org binary distribution
-- Server OS: Win32
-- HeidiSQL Version: 9.4.0.5125
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Dumping database structure for peq4
CREATE DATABASE IF NOT EXISTS `peq4` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `peq4`;
-- Dumping structure for table peq4.rule_values
CREATE TABLE IF NOT EXISTS `rule_values` (
`ruleset_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
`rule_name` varchar(64) NOT NULL DEFAULT '',
`rule_value` varchar(10) NOT NULL DEFAULT '',
`notes` text,
PRIMARY KEY (`ruleset_id`,`rule_name`),
KEY `ruleset_id` (`ruleset_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- Dumping data for table peq4.rule_values: 509 rows
|
If you copied your old server folder, pasted it and renamed it .. Original =EQ , new = EQ1 or something.
Then you went in created a 2nd database. Changed the config.xml file to go to the 2nd database, for some reason I could never get this to work except on a fresh computer that has never had a server on it before. (So, when I took a server from 1 computer to a laptop it worked fine, when I tried to make a 2nd server this way, it would never work unless I defaulted the database to the original database... which the 2nd server I wanted to have its own database).
I just took the eq_emuserver.pl file to an empty folder and ran it. Follow the prompts, and it will work. Then just save that SQL file with the new database info at the top and source it in. Should duplicate that server (or whatever you sourced in).
As far as using the other. You can select the database by opening that file.
Is a > symbol next to the Database name.
If it is opened it becomes a v symbol.
That allows you to edit that database.
As far as choosing in CMD prompt.
You just type
use database peq
use database newpeq
or whatever you named your database.
If you export a database as a SQL file, you have to edit the file itself to point it to the database you want it to update. (Otherwise it tries to update the database you exported the SQL from--- the first portion of this post).