Running Raspian jessie. Working on getting a MySQL database setup to create a time clock solution for a school project. I've got users set up and database created but i'm having trouble using the source command to run a .sql script to create 3 tables.
I'm following a tutorial on instructables, and this sql script file was provided. I can't post the link because I'm new to the forum.
I'm trying to use themysql> \. /attendance/mysql.sql and it says error
This is the contents of the mysql.sql
CREATE TABLE IF NOT EXISTS `cards` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`userId` int(10) unsigned NOT NULL,
`tagId` bigint(18) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
CREATE TABLE IF NOT EXISTS `readings` (
`id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
`tagId` bigint(18) unsigned NOT NULL,
`time` bigint(14) unsigned NOT NULL,
`action` int(2) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
CREATE TABLE IF NOT EXISTS `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
`surname` varchar(255) COLLATE utf8_czech_ci NOT NULL,
`active` enum('0','1') COLLATE utf8_czech_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
Any input is much appreciated.
I'm following a tutorial on instructables, and this sql script file was provided. I can't post the link because I'm new to the forum.
I'm trying to use themysql> \. /attendance/mysql.sql and it says error
This is the contents of the mysql.sql
CREATE TABLE IF NOT EXISTS `cards` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`userId` int(10) unsigned NOT NULL,
`tagId` bigint(18) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
CREATE TABLE IF NOT EXISTS `readings` (
`id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
`tagId` bigint(18) unsigned NOT NULL,
`time` bigint(14) unsigned NOT NULL,
`action` int(2) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
CREATE TABLE IF NOT EXISTS `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
`surname` varchar(255) COLLATE utf8_czech_ci NOT NULL,
`active` enum('0','1') COLLATE utf8_czech_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
Any input is much appreciated.
from xda-developers http://ift.tt/1RQL98L
via IFTTT
Aucun commentaire:
Enregistrer un commentaire