#1064 - SQL syntax Error while trying to import - mysql

DROP TABLE IF EXISTS `migration_versions`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `migration_versions` (
`version` varchar(255) COLLATE utf8mb4_unicode_520_ci NOT NULL,
PRIMARY KEY (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8mb4_unicode_520_ci
/*!40101 SET character_set_client = #saved_cs_client */;
is giving me this error:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SET character_set_client = #saved_cs_client */' at line 5
Update:
This is the original exported statement. The only thing I did was change collations to utf8mb4_unicode_520_ci.
DROP TABLE IF EXISTS `migration_versions`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `migration_versions` (
`version` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = #saved_cs_client */;
Any ideas anyone?

Related

Docker Mariadb dump import not Working: mysql: 1: Syntax error: Unterminated quoted string

I recently exported a dump file from my working MySQL database. I want to run it on a docker MariaDB database. Problem is, that the import is not working. It's throwing the following error message:
Syntax error: Unterminated quoted string.
Do you have any idea what the issue could be? Thank you for your help in advance.
My dump file:
CREATE DATABASE IF NOT EXISTS `trackmap` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE
utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `trackmap`;
-- MySQL dump 10.13 Distrib 8.0.27, for Win64 (x86_64)
--
-- Host: localhost Database: trackmap
-- ------------------------------------------------------
-- Server version 8.0.27
/*!40101 SET #OLD_CHARACTER_SET_CLIENT=##CHARACTER_SET_CLIENT */;
/*!40101 SET #OLD_CHARACTER_SET_RESULTS=##CHARACTER_SET_RESULTS */;
/*!40101 SET #OLD_COLLATION_CONNECTION=##COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET #OLD_TIME_ZONE=##TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET #OLD_UNIQUE_CHECKS=##UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!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' */;
/*!40111 SET #OLD_SQL_NOTES=##SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `gruppe`
--
DROP TABLE IF EXISTS `gruppe`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `gruppe` (
`GroupID` int DEFAULT NULL,
`Name` varchar(30) DEFAULT NULL,
`Beschreibung` varchar(140) DEFAULT NULL,
`GruppenFarbe` varchar(8) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Dumping data for table `gruppe`
--
LOCK TABLES `gruppe` WRITE;
/*!40000 ALTER TABLE `gruppe` DISABLE KEYS */;
INSERT INTO `gruppe` VALUES (1,'tolleGruppe','Eine tolle Gruppe','weiß'),
(2,'superGruppe','Eine super Gruppe','rot');
/*!40000 ALTER TABLE `gruppe` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `user` (
`username` varchar(10) DEFAULT NULL,
`password` varchar(50) DEFAULT NULL,
`geolat` double DEFAULT NULL,
`geolong` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Dumping data for table `user`
--
LOCK TABLES `user` WRITE;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
INSERT INTO `user` VALUES ('Jakob','Jakob',0,0),
('Hendrick','Hendrick',49.99135204584314,8.280738733723956),
('Zoe','Zoe',50.06812365779786,8.236003513207015),
('Lenny','Lenny',51.21475408000626,6.779539564097885),
('Maximilian','Maximilian',53.49847387955471,10.042672857321604);
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `usergruppe`
--
DROP TABLE IF EXISTS `usergruppe`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `usergruppe` (
`GroupID` int DEFAULT NULL,
`Username` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Dumping data for table `usergruppe`
--
LOCK TABLES `usergruppe` WRITE;
/*!40000 ALTER TABLE `usergruppe` DISABLE KEYS */;
INSERT INTO `usergruppe` VALUES (1,'Jakob'),(1,'Zoe'),(1,'Maximilian'),(1,'Lenny'),
(1,'Hendrick');
/*!40000 ALTER TABLE `usergruppe` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=#OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=#OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=#OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=#OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=#OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=#OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=#OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=#OLD_SQL_NOTES */;
-- Dump completed on 2021-12-17 15:53:30

SQL file failing to import into MySQL workbench- "Failed to add the foreign key constraint. Missing column 'userid'"

Ive been trying to import a .SQL file and I know the database works. Can someone please explain why I am getting the below error whilst importing from self-contained file?
ERROR 3734 (HY000) at line 55: Failed to add the foreign key constraint. Missing column 'userid' for constraint 'user_app_FK' in the referenced table 'user'
-- MySQL dump 10.13 Distrib 8.0.12, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: avi_it
-- ------------------------------------------------------
-- Server version 8.0.12
/*!40101 SET #OLD_CHARACTER_SET_CLIENT=##CHARACTER_SET_CLIENT */;
/*!40101 SET #OLD_CHARACTER_SET_RESULTS=##CHARACTER_SET_RESULTS */;
/*!40101 SET #OLD_COLLATION_CONNECTION=##COLLATION_CONNECTION */;
SET NAMES utf8 ;
/*!40103 SET #OLD_TIME_ZONE=##TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET #OLD_UNIQUE_CHECKS=##UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!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' */;
/*!40111 SET #OLD_SQL_NOTES=##SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `application`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `application` ( --line 55
`applicationID` int(11) NOT NULL AUTO_INCREMENT,
`userID` int(11) DEFAULT NULL,
`jobID` int(11) DEFAULT NULL,
`applicationDes` text,
PRIMARY KEY (`applicationID`),
KEY `user_app_FK_idx` (`userID`),
KEY `job_app_FK_idx` (`jobID`),
CONSTRAINT `job_app_FK` FOREIGN KEY (`jobID`) REFERENCES `job` (`jobid`),
CONSTRAINT `user_app_FK` FOREIGN KEY (`userID`) REFERENCES `user` (`userid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = #saved_cs_client */;
DROP TABLE IF EXISTS `user`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `user` (
`userID` int(11) NOT NULL AUTO_INCREMENT,
`personID` int(11) DEFAULT NULL,
PRIMARY KEY (`userID`),
KEY `person_user_FK_idx` (`personID`),
CONSTRAINT `person_user_FK` FOREIGN KEY (`personID`) REFERENCES `person_detail` (`personid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = #saved_cs_client */;
should be just order issue. need to first create the user table

Encoding issue with MySQL and Arabic - Qt 5.8 on Windows 7

I have an application where I use a QSqlQueryModel and a table view to view some data from a mysql database.
I created the database using phpMyadmin and wrote a Python script to read Arabic data from Excel sheets and insert it into the database.
Everything works well on Linux, but when I switched to Windows, the application can't seem to encode the Arabic words correctly.
This is how it looks like for the avilable data:
صودق بالعلاج ةالمتابعه بقسم(المخ والاعصاب)
...and when I insert new data using Qt, the data shows as question marks (?).
Here's the MySQL dump for the database:
-- MySQL dump 10.13 Distrib 5.6.21, for Win32 (x86)
--
-- Host: localhost Database: tasdeek
-- ------------------------------------------------------
-- Server version 5.6.21
/*!40101 SET #OLD_CHARACTER_SET_CLIENT=##CHARACTER_SET_CLIENT */;
/*!40101 SET #OLD_CHARACTER_SET_RESULTS=##CHARACTER_SET_RESULTS */;
/*!40101 SET #OLD_COLLATION_CONNECTION=##COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET #OLD_TIME_ZONE=##TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET #OLD_UNIQUE_CHECKS=##UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!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' */;
/*!40111 SET #OLD_SQL_NOTES=##SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `tasdeek`
--
DROP TABLE IF EXISTS `tasdeek`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tasdeek` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`rank` varchar(15) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`working` varchar(15) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`notes` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`amount` varchar(25) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`relationship` varchar(15) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`startDate` date NOT NULL,
`endDate` date NOT NULL,
`agency` tinyint(4) NOT NULL,
`nationalId` varchar(14) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=899 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Dumping data for table `tasdeek`
--
LOCK TABLES `tasdeek` WRITE;
/*!40000 ALTER TABLE `tasdeek` DISABLE KEYS */;
INSERT INTO `tasdeek` VALUES (2,'مساعد','زياد شسيشسي شيسي','شسيش ','شيشسيشيسشي ي شسيشس ي شسي د','5000','شخصه','2017-02-06','2018-02-06',1,NULL),(3,'اتتلاتل تلات لات لا','سيشس شيشسي شسي ','','شيسيشسي ششي شسف شسيشي شسيشي // تجديد','5000','الوالد','2017-05-11','2018-05-11',1,NULL)
/*!40000 ALTER TABLE `tasdeek` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`userGroup` int(2) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UNIQUE` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Dumping data for table `users`
--
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,'admin','5bdba65d1a953aa83ed8f35ef2877274b5d451d2',0);
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=#OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=#OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=#OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=#OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=#OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=#OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=#OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=#OLD_SQL_NOTES */;
-- Dump completed on 2017-09-13 21:40:59
Note that the old data inserted on Linux is shown properly on phpMyAdmin.
See this fragment from QTextCodec::codecForLocale documentation:
On Windows, the codec will be based on a system locale. On Unix systems, the codec will might fall back to using the iconv library if no builtin codec for the locale can be found.
This could explain why you saw the correct arabic characters on Linux, but not on Windows.
As an alternative in this case, you can "force" the codec using the following instruction in your main.cpp:
QTextCodec::setCodecForLocale( QTextCodec::codecForName("UTF-8") );
PS: Don't forget the #include <QTextCodec> directive.

Sails-mysql Oauth

i am following this tutorial to make oauth server with mongodb, and with mongodb it works fine.
But then i try to change to sails-mysql, but i am having some problems, for example if i change the connection to mysql, if i try to create new client/user it works... but then, if i want to verifi the link, it returns this error:
Error (E_UNKNOWN) :: Encountered an unexpected error
: ER_PARSE_ERROR: 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 'undefined AND `tokens`.`access_token` undefined AND `tokens`.`access_token` unde' at line 1
at Query.Sequence._packetToError (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/sequences/Sequence.js:48:14)
at Query.ErrorPacket (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/sequences/Query.js:83:18)
at Protocol._parsePacket (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Protocol.js:271:23)
at Parser.write (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Parser.js:77:12)
at Protocol.write (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Protocol.js:39:16)
at Socket.<anonymous> (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/Connection.js:92:28)
at Socket.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at TCP.onread (net.js:538:20)
--------------------
at Protocol._enqueue (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Protocol.js:135:48)
at PoolConnection.Connection.query (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/Connection.js:197:25)
at __FIND__ (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/lib/adapter.js:836:20)
at Object.module.exports.adapter.find (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/lib/adapter.js:803:9)
at Array.async.auto.findRecords (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/lib/adapter.js:1056:21)
at /home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/async/lib/async.js:484:38
at _each (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/async/lib/async.js:46:13)
at Object.async.auto (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/async/lib/async.js:455:9)
at __DESTROY__ (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/lib/adapter.js:1053:15)
at afterwards (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/lib/connections/spawn.js:84:5)
at /home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/lib/connections/spawn.js:40:7
at Ping.onPing [as _callback] (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/Pool.js:94:5)
at Ping.Sequence.end (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/sequences/Sequence.js:96:24)
at Ping.Sequence.OkPacket (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/sequences/Sequence.js:105:8)
at Protocol._parsePacket (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Protocol.js:271:23)
at Parser.write (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Parser.js:77:12)
at Protocol.write (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/protocol/Protocol.js:39:16)
at Socket.<anonymous> (/home/mpinto/Escritorio/Guatour/oauth-server/node_modules/sails-mysql/node_modules/mysql/lib/Connection.js:92:28)
at Socket.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at TCP.onread (net.js:538:20)
Details: Error: ER_PARSE_ERROR: 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 'undefined AND `tokens`.`access_token` undefined AND `tokens`.`access_token` unde' at line 1
Generated mysql script:
-- MySQL dump 10.13 Distrib 5.5.43, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: oauth
-- ------------------------------------------------------
-- Server version 5.5.43-0ubuntu0.14.04.1
/*!40101 SET #OLD_CHARACTER_SET_CLIENT=##CHARACTER_SET_CLIENT */;
/*!40101 SET #OLD_CHARACTER_SET_RESULTS=##CHARACTER_SET_RESULTS */;
/*!40101 SET #OLD_COLLATION_CONNECTION=##COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET #OLD_TIME_ZONE=##TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET #OLD_UNIQUE_CHECKS=##UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!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' */;
/*!40111 SET #OLD_SQL_NOTES=##SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `clients`
--
DROP TABLE IF EXISTS `clients`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `clients` (
`name` varchar(255) DEFAULT NULL,
`organization` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`client_id` varchar(255) DEFAULT NULL,
`client_secret` varchar(255) DEFAULT NULL,
`trust_level` varchar(255) DEFAULT NULL,
`redirect_uri` varchar(255) DEFAULT NULL,
`date_registered` varchar(255) DEFAULT NULL,
`date_verified` varchar(255) DEFAULT NULL,
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`),
UNIQUE KEY `client_id` (`client_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Dumping data for table `clients`
--
LOCK TABLES `clients` WRITE;
/*!40000 ALTER TABLE `clients` DISABLE KEYS */;
INSERT INTO `clients` VALUES (NULL,NULL,'mpinto#estratek.com','LdjM89WLIxrKnxExtXHUcq7ViucW20Kj','pew1d XFNWpuTnTjEGhYX495DUhxtDwUH',NULL,NULL,NULL,NULL,1);
/*!40000 ALTER TABLE `clients` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tokens`
--
DROP TABLE IF EXISTS `tokens`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tokens` (
`access_token` varchar(255) DEFAULT NULL,
`refresh_token` varchar(255) DEFAULT NULL,
`code` varchar(255) DEFAULT NULL,
`user_id` varchar(255) DEFAULT NULL,
`expiration_date` date DEFAULT NULL,
`client_id` varchar(255) DEFAULT NULL,
`security_level` varchar(255) DEFAULT NULL,
`scope` varchar(255) DEFAULT NULL,
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Dumping data for table `tokens`
--
LOCK TABLES `tokens` WRITE;
/*!40000 ALTER TABLE `tokens` DISABLE KEYS */;
INSERT INTO `tokens` VALUES ('opSlFDZcPxrFFL0XvLWxiIsyxRZJcIcl','WIwl2x5ZbXBxXUHTC1JUlgAKDtXovPZe','qx RalLE3asf6LCQgclr8GtQ22vtgn1lb',NULL,'2015-06- 25','LdjM89WLIxrKnxExtXHUcq7ViucW20Kj',NULL,NULL,1);
/*!40000 ALTER TABLE `tokens` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`username` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`first_name` varchar(255) DEFAULT NULL,
`last_name` varchar(255) DEFAULT NULL,
`location` varchar(255) DEFAULT NULL,
`date_registered` date DEFAULT NULL,
`date_verified` date DEFAULT NULL,
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`encrypted_password` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Dumping data for table `users`
--
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=#OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=#OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=#OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=#OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=#OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=#OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=#OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=#OLD_SQL_NOTES */;
-- Dump completed on 2015-06-25 14:58:43
How can i fix this?
Thanks.

getting error when importing to phpmyadmin from mysql workbench

i was working in mysql workbench to export my database dump file to upload it to my phpmyadmin database , but i get empaty database , second i'm showing this error :
1044 - Access denied for user 'hesham'#'mocha6004.mochahost.com' to database 'sams'
and my database account have all premisson
my database file code :
CREATE DATABASE IF NOT EXISTS `sams` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `sams`;
-- MySQL dump 10.13 Distrib 5.6.11, for Win32 (x86)
--
-- Host: 127.0.0.1 Database: sams
-- ------------------------------------------------------
-- Server version 5.6.13-log
/*!40101 SET #OLD_CHARACTER_SET_CLIENT=##CHARACTER_SET_CLIENT */;
/*!40101 SET #OLD_CHARACTER_SET_RESULTS=##CHARACTER_SET_RESULTS */;
/*!40101 SET #OLD_COLLATION_CONNECTION=##COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET #OLD_TIME_ZONE=##TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET #OLD_UNIQUE_CHECKS=##UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!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' */;
/*!40111 SET #OLD_SQL_NOTES=##SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `class`
--
DROP TABLE IF EXISTS `class`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `class` (
`CLASS_ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`CLASS_NAME` varchar(45) NOT NULL,
`GRAdE_ID` varchar(45) NOT NULL,
`STAGE_ID` varchar(45) NOT NULL,
`school_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`CLASS_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Dumping data for table `class`
--
LOCK TABLES `class` WRITE;
/*!40000 ALTER TABLE `class` DISABLE KEYS */;
INSERT INTO `class` (`CLASS_ID`, `CLASS_NAME`, `GRAdE_ID`, `STAGE_ID`, `school_id`) VALUES (1,'1-10','1','1',1),(3,'2-20','1','1',1);
/*!40000 ALTER TABLE `class` ENABLE KEYS */;
UNLOCK TABLES;