• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

MySQL Import Error

J

jz1977

Guest
Now when i click on my database that i created with plesk, i Go into phpMyAdmin and click on the database, then i click on query window and so i try to import many different databases but it keeps comming back with "Error - There was an Error in your Query. I know there are no errors due to the fact that i used these same database files like 2 days before on a different Box. So there must be something wrong or something that i am not doing correctly. The only thing that i see with cause is this
"Database dotnetnuke running on localhost "
and
Structure - SQL (clickable)
Export - Search - Query (greyed out)

Any Idea's Here?
 
Hy,

which Version do you have of Plesk ?
Have you installed the last patch ?
 
It's because there is nothing there, nada, not even a blank table. You need to create a table of some sort from the command prompt or copy them over to \mysql\data\databasename\ Some sort of table needs to be there to use PHPMyAdmin
 
What are the contents of the file that you`re trying to import? If it`s a series of CREATE TABLE... and INSERT... statements, you should be okay. However, it shouldn`t contain any CREATE DATABASE... statements.

If you need multiple databases, create them in the PSA admin, then import each database`s tables separately through the phpMyAdmin interface.
 
I am tring to import DotNetNuke databases. It worked before in phpMyAdmin a few days ago ... but that was with the PLESK server not installed. I will post a partial data base file here.

-------------- First few lines ---------------------
SQL-query :

/************************************************************//***** Create Tables *****//************************************************************/ CREATE TABLE [dbo].[BannerTypes](

[BannerTypeId][int]IDENTITY( 1, 1 ) NOT NULL ,
[BannerTypeName][nvarchar]( 50 ) NOT NULL
) ON [ PRIMARY ]GO CREATE TABLE [dbo].[Classification](
[ClassificationId][int]IDENTITY( 1, 1 ) NOT NULL ,
[ClassificationName][nvarchar]( 200 ) NOT NULL ,
[ParentId][int] NULL
) ON [ PRIMARY ]GO CREATE TABLE [dbo].[CodeCountry](


----------------------------End----------------------

Here is the error i get


-----------Error-------------------
#1064 - 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 '[dbo].[BannerTypes]( [BannerTypeId][int]IDENTITY( 1, 1 ) NOT
[

----------End----------------

is the line at the top of the database where is says Create. should i take that line out?

Dont understand.. it worked perfectly the other day

-Jeff
 
its like every line has create table...

/************************************************************/
/***** Create Tables *****/
/************************************************************/

CREATE TABLE [dbo].[BannerTypes] (
[BannerTypeId] [int] IDENTITY (1, 1) NOT NULL ,
[BannerTypeName] [nvarchar] (50) NOT NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Classification] (
[ClassificationId] [int] IDENTITY (1, 1) NOT NULL ,
[ClassificationName] [nvarchar] (200) NOT NULL ,
[ParentId] [int] NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CodeCountry] (
Code:
 [char] (2) NOT NULL ,
	[Description] [varchar] (100) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CodeCurrency] (
	[Code] [char] (3) NOT NULL ,
	[Description] [varchar] (100) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CodeFrequency] (
	[Code] [char] (1) NOT NULL ,
	[Description] [nvarchar] (50) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[CodeRegion] (
	[Code] [char] (2) NOT NULL ,
	[Description] [varchar] (100) NOT NULL ,
	[Country] [char] (2) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[FAQs] (
	[ItemID] [int] IDENTITY (0, 1) NOT NULL ,
	[ModuleID] [int] NOT NULL ,
	[CreatedByUser] [nvarchar] (100) NULL ,
	[CreatedDate] [datetime] NULL ,
	[Question] [text] NULL ,
	[Answer] [text] NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [dbo].[Files] (
	[FileId] [int] IDENTITY (1, 1) NOT NULL ,
	[PortalId] [int] NULL ,
	[FileName] [nvarchar] (100) NOT NULL ,
	[Extension] [nvarchar] (100) NOT NULL ,
	[Size] [int] NOT NULL ,
	[Width] [int] NULL ,
	[Height] [int] NULL ,
	[ContentType] [nvarchar] (200) NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[ModuleDefinitions] (
	[ModuleDefID] [int] IDENTITY (1, 1) NOT NULL ,
	[FriendlyName] [nvarchar] (128) NOT NULL ,
	[DesktopSrc] [nvarchar] (256) NULL ,
	[MobileSrc] [nvarchar] (256) NULL ,
	[AdminOrder] [int] NULL ,
	[EditSrc] [nvarchar] (256) NULL ,
	[Secure] [bit] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Portals] (
	[PortalID] [int] IDENTITY (-1, 1) NOT NULL ,
	[PortalAlias] [nvarchar] (200) NOT NULL ,
	[PortalName] [nvarchar] (128) NOT NULL ,
	[UploadDirectory] [nvarchar] (100) NOT NULL ,
	[LogoFile] [nvarchar] (50) NULL ,
	[FooterText] [nvarchar] (100) NULL ,
	[ExpiryDate] [datetime] NULL ,
	[UserRegistration] [int] NULL ,
	[BannerAdvertising] [int] NULL ,
	[AdministratorId] [int] NULL ,
	[PayPalId] [nvarchar] (50) NULL ,
	[Currency] [char] (3) NULL ,
	[HostFee] [nvarchar] (10) NULL ,
	[HostSpace] [int] NULL ,
	[AdministratorRoleId] [int] NULL ,
	[RegisteredRoleId] [int] NULL ,
	[GUID] [uniqueidentifier] NOT NULL CONSTRAINT DF_Portals_GUID DEFAULT newid()
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Users] (
	[UserID] [int] IDENTITY (1, 1) NOT NULL ,
	[FirstName] [nvarchar] (50) NOT NULL ,
	[LastName] [nvarchar] (50) NULL ,
	[Street] [nvarchar] (20) NULL ,
	[City] [nvarchar] (20) NULL ,
	[Region] [nvarchar] (20) NULL ,
	[PostalCode] [nvarchar] (10) NULL ,
	[Country] [nvarchar] (20) NULL ,
	[Password] [nvarchar] (20) NOT NULL ,
	[Email] [nvarchar] (100) NOT NULL ,
	[CreatedDate] [datetime] NULL ,
	[LastLoginDate] [datetime] NULL ,
	[Unit] [nvarchar] (50) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Version] (
	[VersionId] [int] IDENTITY (1, 1) NOT NULL ,
	[Major] [int] NOT NULL ,
	[Minor] [int] NOT NULL ,
	[Build] [int] NOT NULL ,
	[Comment] [varchar] (100) NOT NULL ,
	[CreatedDate] [datetime] NOT NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Roles] (
	[RoleID] [int] IDENTITY (0, 1) NOT NULL ,
	[PortalID] [int] NULL ,
	[RoleName] [nvarchar] (50) NOT NULL ,
	[Description] [nvarchar] (1000) NULL ,
	[ServiceFee] [decimal](5, 2) NULL ,
	[BillingFrequency] [char] (1) NULL ,
	[TrialPeriod] [int] NULL ,
	[TrialFrequency] [char] (1) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[SiteLog] (
	[SiteLogId] [int] IDENTITY (1, 1) NOT NULL ,
	[DateTime] [smalldatetime] NOT NULL ,
	[PortalId] [int] NOT NULL ,
	[UserId] [int] NULL ,
	[Referrer] [nvarchar] (255) NULL ,
	[Url] [nvarchar] (255) NULL ,
	[UserAgent] [nvarchar] (255) NULL ,
	[UserHostAddress] [nvarchar] (255) NULL ,
	[UserHostName] [nvarchar] (255) NULL 
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Tabs] (
	[TabID] [int] IDENTITY (0, 1) NOT NULL ,
	[TabOrder] [int] NOT NULL ,
	[PortalID] [int] NULL ,
	[TabName] [nvarchar] (50) NOT NULL ,
	[MobileTabName] [nvarchar] (50) NOT NULL ,
	[AuthorizedRoles] [nvarchar] (256) NULL ,
	[ShowMobile] [bit] NOT NULL ,
	[LeftPaneWidth] [nvarchar] (5) NOT NULL ,
	[RightPaneWidth] [nvarchar] (5) NOT NULL ,
	[IsVisible] [bit] NOT NULL 
) ON [PRIMARY]
GO



how do iget around this?
 
mt bad he said create database i over looked that as create table. confusing?
 
Eek. Those look like MS SQL statements.

If you want them in MySQL, change things like

CREATE TABLE [dbo].[BannerTypes] (
[BannerTypeId] [int] IDENTITY (1, 1) NOT NULL ,
[BannerTypeName] [nvarchar] (50) NOT NULL
) ON [PRIMARY]
GO

to

CREATE TABLE BannerTypes (
BannerTypeId INT AUTO_INCREMENT NOT NULL ,
BannerTypeName VARCHAR(50) NOT NULL
)



Click here to get to the MySQL documentation on CREATE TABLE syntax for the rest of your tables. Then do a search for "insert syntax" for help changing any INSERT statements you may have.

Otherwise, just use your original statements in a MS SQL database. I have pretty much zero experience with MS SQL, so I won`t be any help there. :(
 
maybe this is a MS SQL database file? my bad again. Installed this the other day useing MSSQL Server. So i bet MySql Will not work for this. I am going to Try to load it in MSSQL Server and see if that works.. I am guessing since that this is a database code for ASP.NET software It wont wrk in MYSQL. could this be the problem why i am not able to imort?
 
Just thought of something

If you want, I have some software that will convert data from a MS SQL server into a MySQL dump file. All I need is the username/password and the hostname or IP of the SQL server and I can convert the data for you, which you can then import into your MySQL database.

It doesn`t do stored procedures, but I don`t think you`ll have to worry about that.
 
Thanks ive posted above before checking the forum.. thanks.. i will try MSSQL.


-Jeff
 
yeah that would be cool.. contact me on AIM : JJZ1977 or Yahoo:JZ1977
 
In regards to the MSSQL or MySQL with ASP.NET standard SQL queries work fine with MySQL and so does the ADO recordset in ASP.NET. Some things are different for ASP.NET with MySQL, but most work.
 
Back
Top