mysql-error-1146

restoring a MySQL database

你说的曾经没有我的故事 提交于 2019-12-03 02:24:41
I have created a file named ab.sql using the mysqldump utility of a database named library. It worked fine. Now i am trying to restore it using mysqlimport. My database already exists. But i want to override it. I am using the command mysqlimport -uroot -p**** library D:/ab.sql in the command line but it gives an error that says, mysqlimport: Error: 1146, Table 'library.ab' doesn't exist, when using table: ab desperately need help. froody mysqlimport reads rows from a text file into a database. mysqldump outputs a file full of SQL statements, not simple rows. You can run those SQL statements

MySql - I dropped general_log table

こ雲淡風輕ζ 提交于 2019-12-02 18:12:06
Logging enabled I enabled logging using : SET GLOBAL log_output = 'TABLE'; SET GLOBAL general_log = 'ON'; All executed queries was logging to mysql.general_log table. It is fine. Attempt to clear the table Then the table became large and I wanted to delete all records from the table. I executed: DELETE FROM general_log But this caused to an error that says I cannot lock log tables. So, I dropped the table after disabling logging: SET GLOBAL general_log = 'OFF'; DROP TABLE general_log; I hope that enabling logging again will create the table, but I couldn't enable it. When I execute this: SET

MySQL Pass table name to cursor select

元气小坏坏 提交于 2019-12-01 00:21:55
I want the procedure to take parameter answertable and partid in the select statement, but when i call it it doesn't replace the parameter answertable with the value the call call updateTotalScores('quiz_participation', 'quiz_answer', 1) returns the error: 1146 - Table 'quizdb.answertable' doesn't exist passing the id works, but passing the table name doesn't so how do i pass the table name to the select in DECLARE cur1 CURSOR FOR SELECT SUM(`score`), SUM(`maxscore`) FROM answertable WHERE `idParticipation`=partid; entire procedure: DELIMITER $$ CREATE PROCEDURE updateTotalScores(IN

InnoDB tables exist in MySQL but says they do not exist after copying database to new server

穿精又带淫゛_ 提交于 2019-11-30 07:29:14
I used mysqldump to export my database and then I imported it into MySQL on my other server. I can now see all my tables if I do "show tables" but I can't actually select from or describe any of them. ERROR 1146 (42S02): Table 'mydatabase.user' doesn't exist All of my tables are InnoDB. I saw one issue people had where they were using old_passwords, so I explicitly set that to 0 in my.cnf and I made sure all of the passwords in the mysql table were 41 hexadecimal digits as they should be for the new passwords. RolandoMySQLDBA The reason "show tables;" works is because mysqld will scan the

Populating a database in a Laravel migration file

折月煮酒 提交于 2019-11-28 15:37:44
I'm just learning Laravel, and have a working migration file creating a users table. I am trying to populate a user record as part of the migration: public function up() { Schema::create('users', function($table){ $table->increments('id'); $table->string('email', 255); $table->string('password', 64); $table->boolean('verified'); $table->string('token', 255); $table->timestamps(); DB::table('users')->insert( array( 'email' => 'name@domain.com', 'verified' => true ) ); }); } But I'm getting the following error when running php artisan migrate : SQLSTATE[42S02]: Base table or view not found: 1146

Populating a database in a Laravel migration file

烈酒焚心 提交于 2019-11-27 19:47:15
问题 I'm just learning Laravel, and have a working migration file creating a users table. I am trying to populate a user record as part of the migration: public function up() { Schema::create('users', function($table){ $table->increments('id'); $table->string('email', 255); $table->string('password', 64); $table->boolean('verified'); $table->string('token', 255); $table->timestamps(); DB::table('users')->insert( array( 'email' => 'name@domain.com', 'verified' => true ) ); }); } But I'm getting the

In MySQL: How to pass a table name as stored procedure and/or function argument?

别来无恙 提交于 2019-11-27 14:30:23
问题 For instance, this does not work: DELIMITER // CREATE PROCEDURE countRows(tbl_name VARCHAR(40)) BEGIN SELECT COUNT(*) as ct FROM tbl_name; END // DELIMITER ; CALL countRows('my_table_name'); Produces: ERROR 1146 (42S02): Table 'test.tbl_name' doesn't exist However, this works as expected: SELECT COUNT(*) as ct FROM my_table_name; What syntax is required to use an argument as a table name in a select statement? Is this even possible? 回答1: Prepared statements are what you need. CREATE PROCEDURE

MySQL Table does not exist error, but it does exist

为君一笑 提交于 2019-11-27 13:58:25
Does anyone know under what conditions you can receive an 1146: Table '<database>.<table>' doesn't exist error when your table does, in fact, exist? I use the same code on 5 servers, only one that I recently rented is showing this error, so I suspect it may be a settings or install error of some kind. I can execute my sql statement from the command line just fine. I can, obviously, see the table from the command line as well. I don't get any connection errors when I establish a connection (I'm using mysqli, btw). Any help would be appreciated. exact query: $sql = "SELECT DISTINCT(mm_dic_word)

Bug? #1146 - Table 'xxx.xxxxx' doesn't exist

余生长醉 提交于 2019-11-27 01:19:09
I am using windows XP. I am creating a table in phpMyAdmin using its built-in create table feature, my database name is ddd . It generates the following code: CREATE TABLE `ddd`.`mwrevision` ( `asd` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `sddd` INT NOT NULL ) ENGINE = INNODB; and the following error shows up: MySQL said: #1146 - Table 'ddd.mwrevision' doesn't exist What might be the problem? sempasha I also had same problem in past. All had happend after moving database files to new location and after updating mysql server. All tables with InnoDB engine disappeared from my database. I was

Mysql 1050 Error “Table already exists” when in fact, it does not

风流意气都作罢 提交于 2019-11-26 18:24:40
I'm adding this table: CREATE TABLE contenttype ( contenttypeid INT UNSIGNED NOT NULL AUTO_INCREMENT, class VARBINARY(50) NOT NULL, packageid INT UNSIGNED NOT NULL, canplace ENUM('0','1') NOT NULL DEFAULT '0', cansearch ENUM('0','1') NOT NULL DEFAULT '0', cantag ENUM('0','1') DEFAULT '0', canattach ENUM('0','1') DEFAULT '0', isaggregator ENUM('0', '1') NOT NULL DEFAULT '0', PRIMARY KEY (contenttypeid), UNIQUE KEY packageclass (packageid, class) ); And I get a 1050 "table already exists" But the table does NOT exist. Any ideas? EDIT: more details because everyone seems to not believe me :)