I'm trying to import a .csv file into a table using MySQL WB. It was working fine up until I truncated a table, now I seem to have edit access via the workbench revoked. I've recreated the table from a create statement I have on backup, but the Import button is still not the. The problem seems to be there for this specific table only, all other ones are fine. Has anyone come across this before?
Ah, answered it myself ) just needed to ad primary key column
Sometimes it can hidden in low display resolution (height < 960), I've overcome this issue by setting high resolution (height > 768) once. I think it would be help someone.
make sure you have at-least one column as Primary. otherwise the file load option wont show. I believe thats because it wants to make sure the primary key has no null value when importing data in.
Related
context
I have been working on a new wordpress blog as a personal website. Part of it, I have a custom contact form where people put in their details to get in touch with me.It has been working good till morning, after which I have updated to 4.2.2v citing security reasons.
problem
After the update, the form is failing to save any of the information into the DB. The $wpdb->insert_id is returning 0. The query is the same, the page is the same, everything is just the same. The only change is I have upgraded to 4.2.2v from 4.2.1v.
Is there any issue with the recent update or do I have to do any more steps after the word press manual update ?
debugging done...
I have ensured that the DB version is updated. It is showing 31535. When debugging using the $wpdb->lastquery and $wpdb->print_error() I get
WordPress database error: []
SHOW FULL COLUMNS FROM `wp_tst_tbl_contacts`
?
I could not understand what is wrong here. If I run the same insert query, as well as the above show full columns on command line using the same user wp user credentials, it works perfectly.
note: If there is anymore information needed, please ask.
I found the problem cause. Its due to a column width limitation.
I have a VARCHAR(9) column and I was sending data that is 16 char length. The new change in the 4.2.2 gets the table meta and crops the data such that it fits properly into the size of the column as defined in DB. And it also compares the pre-crop and post-crop data. If they don't match, it is failing.
The problem is, its failing silently with no error thrown. I have found this via debugging the wpincludes/wp-db.php file.
Please check your column limit and the column data length you send.
Once I have increased the column width (as the data will definitely be more than 9 chars), the issue got resolved.
I was experiencing this same issue and it turned out to be some unescaped values being pushed into the database from a csv import function.
I applied the proper esc_url() and / or esc_attr() and / or esc_html() where appropriate to sanitize the values pre-insertion and then the query ran successfully.
I am having an issue with a table within my database whereas I cannot execute any queries against it.
I checked my syntax multiplie times and after discovering there was no problem with it I went into PHPMyadmin and have uncovered the following issue which I have not come across before.
When I try to browse the rows in my table (of which there are over 2000) it won't let me browse and comes up with the following error. This is even when I click the table name in the list in the left menu.
As you can see it is trying to organise the rows using an ORDER BY whenever I try and access the table and I don't know why it is trying to do this.
Can anybody shed any light on this?
Thanks
Your order by clause does not contain column name
I managed to sort this issue by deleting and re-creating the table but am still unsure as to why it was adding a default ORDER BY whenever I was trying to access the table.
If anybody could shed any light on this it would be very helpful if it were to happen again!
Thanks
It is very strange what is happening, I have never seen this before and I am pretty familiar with mysql.
When searching a table using the phpMyAdmin table search feature, the result is empty no matter what I put. For example, searching 77 in the ID column returns empty result. However if I run an SQL query also in phpMyAdmin, and then there is the result. For example, select * from table1 where id = ‘77’;
What is even more strange is this only happens on one table, all other tables the search feature is working fine.
I tried repairing the table but empty result still occurs.
I couldn’t find this happening anywhere to any one online…..
Also restarted sql server.
Are you using cPanel - if yes I just described how to fix the problem on cPanel forums:
http://forums.cpanel.net/f5/unable-use-phpmyadmin-search-users-table-313381.html
If your table has a large number of fields an update via the phpMyAdmin interface can exceed the value for the PHP setting 'max_input_vars'. When this happens some of the internal form fields that phpMyAdmin is expecting to receive on the page your update is being posted to are truncated which causes phpMyAdmin to fail, unfortunately silently, and the page redirects with no warnings back to the blank search form. The default for 'max_input_vars' is 1000. I upped mine in my php.ini file to 5000 with no negative side affects and it solved this problem for me.
The setting 'max_input_vars' has a mode of PHP_INI_PERDIR so if you don't have access to your php.ini file then you may be able to set it in an .htaccess file, your httpd.conf file or your .user.ini (since PHP 5.3) file if you have one. I'm not sure exactly what code you would need for an htaccess file but the PHP code to do it is below.
ini_set('max_input_vars', '5000');
Hopefully that should get you started in the right direction.
Very easy. Go to the table and expose max number of rows as much as is showed in the dropdown. Then you are able to search per big pages. It doesnt fetch text through all the table. It plays only with a page of the table.
I have a procedure mst2 which creates a minimum spanning tree and updates a table MST in my database with several values. It works fine with WAMP but acts crazy when I try to import it on a live server.
Currently, every time I reload the table random values appear in it and seem to go up and down?? I have no idea what's going on. I'm not even calling the function but the table appears to be dynamically adjusting constantly.
I would post my code but it might be overkill, it's pretty extensive. If anybody has a general idea about what can cause this please let me know.
The problem was the fact that I was referencing the table in lowercase as 'mst' in some parts of the code relying on the fact that MySQL isn't case sensitive. Apparently the server I was importing to (Linux) had MySQL configured to be case sensitive for table (and possibly column?) names, fixing the table name in the code from lower to upper solved the issue.
I am having a particularly weird problem putting the data into my production server. My test server runs MySQL 5.1.41. I export the database (tried both via mysqldump and PHPMyAdmin) and then try to import into my production server that runs MySQL 5.0.92.
In one of the tables, I get an error "#1062 - Duplicate entry '1' for key 1". That table has a PRIMARY key and a UNIQUE composite key. When I look into output of phpmyadmin error, I do not see any duplicates.
I already tried:
- exporting with the option "add AUTO INCREMENT"
- checking whether the collations are the same. They are. Besides, the keys in question are numerics.
So if anybody knows what could be causing the error, and how to fix it - I would appreciate it.
Try to remove the index from the table in a dump and then, when all the data will be imported, add it manually.
If everything works fine in the source database, the only thing that I can think of is that the target database doesn't set the appropriate column to AUTO_INCREMENT.
Have you tried creating that table manually in the target database and setting the column in question to AUTO_INCREMENT before importing the source dump?
The the solution was to remove the AUTO_INCREMENT attribute from columns before importing. Still do not understand why, though. The indexes could actually stay. Then the AUTO_INCREMENT could be easily added back. A mixture of what Martin & Silver Light proposed, but I guess none of the answers were exactly right.