associating a database created outside of Virtualmin with a virtual server?

Can a MySQL database created outside of Virtualmin be associated with a virtual server that has been created in Virtualmin?

Status: 
Closed (fixed)

Comments

Nevermind, I found it:

  1. select the virtual server in Virtualmin
  2. click the "Edit Databases" link
  3. click the "Import Database" tab
  4. select the database
  5. click the "Import Now" button

Yes, that will do it.

Automatically closed -- issue fixed for 2 weeks with no activity.

I'm also trying to import a database using your method above.

However, when I click on import database, it states "This form allows you to bring existing manually created databases on the system under the ownership of this virtual server. However, there are no un-owned databases on the system."

I don't have an option to import a database? Any ideas?

mklee - that message will appear if all your MySQL and PostgreSQL databases are already owned by other domains. Or if the database you want to import is one of those used by MySQL internally, like mysql or information_schema .

Hi Jamie,

Thanks for your reply.

I'm been pulling my hair out for the last week trying to get my site up - it's a job board. My site is now hosted by Daily, and not by my last hosting company.

I seem to have a information_schema database. Can you please tell me (in simple terms please!) where I go from here?

help!

Regards, Quentin.

There may be some confusion about what Virtualmin means by "importing".

If you go to Webmin -> Servers -> MySQL Databases, does this database appear on the list?

If not, I am guessing that you have an SQL file which is a database dump that you want to import. If so, the steps to follow are :

  1. Select the domain from the left menu, and go to Edit Databases, click on the domain's existing database, then the Manage Database button.

  2. Click the Execute SQL button.

  3. Go to the "Run SQL from file" tab, select the file you want to import, then click "Execute".

Thanks for the reply and instructions.

However, it comes up with this error:

Output from uploaded SQL commands ..

ERROR 1008 (HY000) at line 12: Can't drop database 'mydomains_'; database doesn't exist

Any ideas?

Regards, Quentin

Sorry, I should mention that after clicking through: Webmin -> Servers -> MySQL Databases - "mysql" DOES appear on the list with 17 tables.

Regards, Quentin.

Try removing any statements like "drop database" or "create database" from the SQL file, then re-running it.

I'm afraid it comes up with this error:

ERROR 1064 (42000) at line 12: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mydomains_ DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci' at line 1

=================================

This is the original sql file statement

-- phpMyAdmin SQL Dump
-- version 2.8.2.4
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Jan 16, 2010 at 12:36 PM
-- Server version: 5.0.22
-- PHP Version: 5.2.6
--
-- Database: `mydomains_`
--
DROP DATABASE `mydomains_`;
CREATE DATABASE `mydomains_` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `mydomains_`;

And this is what it look like when I remover "drop and create database"

-- phpMyAdmin SQL Dump
-- version 2.8.2.4
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Jan 16, 2010 at 12:36 PM
-- Server version: 5.0.22
-- PHP Version: 5.2.6
--
-- Database: `mydomains_`
--  `mydomains_`;
`mydomains_` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `mydomains_`;

Any ideas at all?

Sorry, what I meant was that you should remove the whole line :

DROP DATABASE \`mydomains_\`;
CREATE DATABASE \`mydomains_\` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE \`mydomains_\`;

I executed this sql statement:

-- phpMyAdmin SQL Dump -- version 2.8.2.4 -- http://www.phpmyadmin.net -- -- Host: localhost:3306 -- Generation Time: Jan 16, 2010 at 12:36 PM -- Server version: 5.0.22

-- PHP Version: 5.2.6

-- Database: mydomains_

Came up with "No data returned" ??