mysql-error-1005

Mysql ERROR 1005 (HY000): Can't create table 'tmp' (errno: 13)

佐手、 提交于 2019-12-18 12:26:16
问题 I'm Running Mysql on ubuntu 9.10, the process of Mysql is running as root, I'm using root account when logging to Mysql, which I gave all privileges, I'm using my own db(not mysql), I can create a table, but when i try to create Temporary table i get this error: ERROR 1005 (HY000): Can't create table 'tmp' (errno: 13) For this query: CREATE TEMPORARY TABLE tmp (id int); I've plenty of space in my hard drive, all permissions are granted(also var/lib/mysql have mysql permissions). Any idea?

Problem adding Foreign Key using Alter Table with existing MYSQL Database - can't add it! Help!

 ̄綄美尐妖づ 提交于 2019-12-17 19:38:49
问题 I have a production database where I have renamed several column's that are foreign keys. Obviously mysql makes this a real pain to do in my experience. My solution was to drop all the indexes and foreign keys, rename the id columns, and then re-add the indexes and foreign keys. This works great on mysql 5.1 on windows for the development database. I went to run my migration script on my debian server, which is also using mysql 5.1, and it gives the following error: mysql> ALTER TABLE

SQL - error code 1005 with error number 121

蓝咒 提交于 2019-12-17 18:53:20
问题 I'm running the following MySQL script (trimmed down), generated automatically by MySQL Workbench and I get the following error: Error Code: 1005 Can't create table 'regula.reservation' (errno: 121) I'm not very proficient with databases and this error is not very informative. What is the problem here? -- ----------------------------------------------------- -- Table `regula`.`Users` -- ----------------------------------------------------- DROP TABLE IF EXISTS `regula`.`Users` ; CREATE TABLE

Error Code: 1005. Can't create table '…' (errno: 150)

瘦欲@ 提交于 2019-12-17 01:40:21
问题 I searched for a solution to this problem on the Internet and checked the Stack Overflow questions, but none of the solutions worked for my case. I want to create a foreign key from table sira_no to metal_kod. ALTER TABLE sira_no ADD CONSTRAINT METAL_KODU FOREIGN KEY(METAL_KODU) REFERENCES metal_kod(METAL_KODU) ON DELETE SET NULL ON UPDATE SET NULL ; This script returns: Error Code: 1005. Can't create table 'ebs.#sql-f48_1a3' (errno: 150) I tried adding an index to the referenced table:

Foreign Key Error on MySQL CREATE TABLE statement (err: 150)

邮差的信 提交于 2019-12-11 04:04:23
问题 I feel I've tried everything possible on a very simple pair of create table statements. The types match, I tried using ENGINE = InnoDB, etc and am stumped why I'm getting the foreign key error. I've been away from SQL for some time, so this is probably an easy one. mysql> CREATE TABLE foo_ent(yyy_no VARCHAR(80), -> zoo VARCHAR(80), -> PRIMARY KEY (yyy_no)); Query OK, 0 rows affected (0.01 sec) mysql> CREATE TABLE cat_ent(some_item INTEGER, -> yyy_no VARCHAR(80), -> apple DECIMAL(6,2), ->

mysql_connect doesn't work second time

不羁岁月 提交于 2019-12-11 02:49:14
问题 duplicate of unanswered: How to reconnect in php adodb after exceptions: Mysql server gone away or Lost connection to MySQL server during query mysql_connect works the first time, but never works after that... $connectDb = mysql_connect(secret, secret, secret); mysql_select_db("secret", $connectDb); $sleepPeriod = 1800; sleep($sleepPeriod); while (true) { $result = mysql_query("good query", $connectDb); if (!$result) { if (mysql_error()=='MySQL server has gone away') { echo "MySql connection

MySQL 1005 error when creating table using InnoDB engine

五迷三道 提交于 2019-12-11 01:28:26
问题 When I try to create a table with the following definition, CREATE TABLE `demo` ( `id` INT(11) NOT NULL auto_increment, `x_id` INT(11) NOT NULL, `y_id` INT(11) NOT NULL, `z_id` INT(11) NOT NULL, `status` TINYINT unsigned NOT NULL, `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), CONSTRAINT UNIQUE INDEX(x_id, y_id) ) ENGINE=InnoDB; an OperationalError occurs: _mysql_exceptions.OperationalError: (1005, "Can't create table 'xxx.frm' (errno: -1)") It works if I remove the

MySQL: error 150 using ON UPDATE SET NULL and ON DELETE SET NULL, why?

瘦欲@ 提交于 2019-12-10 14:15:07
问题 i have this: DROP TABLE IF EXISTS `sf_guard_user`; CREATE TABLE `sf_guard_user` ( `id` INTEGER(11) NOT NULL AUTO_INCREMENT, `username` VARCHAR(128) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `sf_guard_user_U_1` (`username`) )Type=InnoDB; DROP TABLE IF EXISTS `shop_orders`; CREATE TABLE `shop_orders` ( `orders_id` INTEGER(11) NOT NULL AUTO_INCREMENT, `sfgu_id` INTEGER(11) NOT NULL, PRIMARY KEY (`orders_id`), INDEX `shop_orders_FI_1` (`sfgu_id`), CONSTRAINT `shop_orders_FK_1` FOREIGN KEY (`sfgu

Programmatic Equivalent Of Import in phpMyAdmin

允我心安 提交于 2019-12-10 10:44:59
问题 I have a SqlDump.sql file that works just fine when I apply it using the Import feature of phpMyAdmin, however I need to be able to accomplish this programmatically. Being a noob, I tried to do something like this: $SQL=file_get_contents('SqlDump.sql'); $DB=mysqli_connect('localhost','root',''); mysqli_select_db($DB,'somedb'); if (mysqli_multi_query($DB, $SQL)) { do { if ($result = mysqli_store_result($DB)) { mysqli_free_result($result); } } while (mysqli_next_result($DB)); } $Err=mysqli

MySQL Workbench - Forward Engineering - Error 1005: Can't create table (errno: 150)

坚强是说给别人听的谎言 提交于 2019-12-10 10:31:35
问题 I am on MacOSX using MySQL Workbench 5.2.45 I have designed a database using the EER Diagram functionality and then tried the forward engineering to generate my database to put on my local server. I get the error code: Error 1005: Can't create table (errno: 150) SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; CREATE SCHEMA IF NOT EXISTS