error occured while click on table in phpmyadmin - mysql

pop-up
some errors have been detected on the server please look at the bottom of this window.
Notice in ./libraries/structure.lib.php#1881
Undefined index: Rows
Backtrace
./libraries/structure.lib.php#2382: getHtmlForRowStatsTable(
array,
NULL,
boolean false,
boolean false,
string '',
string '',
)
./libraries/display_structure.inc.php#263: PMA_getHtmlForDisplayTableStats(
string '',
NULL,
NULL,
boolean false,
NULL,
string '?db=SD&table=sdLogin&token=9d4015ef2a6184f763cb956b670ca8af&goto=tbl_structure.php&back=tbl_structure.php',
NULL,
)
./tbl_structure.php#163: require_once(./libraries/display_structure.inc.php)

It seems any one of two problem occurring in your case:-
Either at the time of installation some problem occur because of that when you are clicking on table this error occur.
either there is some problem at the time of table or database creation.
Solution:-
first try to delete table and try to implode or recreate it.
If not success then try to do the same with its database and then create table.
If again not successful,then try to create another table and check same error happening or not?
If yes then uninstall your xampp/wamp/lamp and reinstalled and check.

Delete database you have created and try to create again.

This error occurs when you have uppercase characters in the tables' names. If you change their names to lowercase, the problem will be gone.

Related

Cannot change to BOOLEAN a column in table using DBeaver

I have one table in MySQL where I would like to change the "Data type" of two columns in DBeaver (version 22.3.4). The two columns are MD_Estimated and BL_Estimated as you can see in this image:
However, when I save the changes, this is the code which is run:
ALTER TABLE Kruda_Denta_Datumbazo.CrownDiameterTable MODIFY COLUMN MD_Estimated BOOL NULL;
ALTER TABLE Kruda_Denta_Datumbazo.CrownDiameterTable MODIFY COLUMN BL_Estimated BOOL NULL;
But the problem is that it does not return any error, but the "Data type" is not saved as BOOL, but as tinyint(1), as you can see in this image:
Am I doing something wrong?
TINYINT(1) and boolean are synonymous In MySQL. Bool is converted to TINYINT(1) under the hood.

"Field 'name' doesn't have a default value" when `name` is explicitly being provided

I'm having a very strange error. The extra weird thing is that it only happens on the development host, but not locally, despite that both are running the exact same code. The only difference is what database they're writing to, but I can insert just fine at the mysql console.
If I try the following query at the Rails console:
Category.create!(:name => "FOOBAR", :parent_id => 141)
I get this error:
ActiveRecord::StatementInvalid: Mysql2::Error: Field 'name' doesn't have a default value:
INSERT INTO `taxons` (`type`, `parent_id`, `created_at`, `updated_at`) VALUES ('Category',
141, '2020-02-05 18:48:54', '2020-02-05 18:48:54')
I'm literally providing the value for name, so I don't understand why it's not using it when it tries to create and validate the new record.
ETA: It's definitely a database issue, because if I run the local code with the development database, I get the same error. I can't directly make changes to the database (i.e. I have to ask the devops team to do it), but I guess the real question is about what needs to change there for this to work? The difference between the two databases is that locally, it allows for name to have DEFAULT NULL, and on development, it's NOT NULL, but why should this be necessary, if I'm always supplying a value for name?
I edited database.yml to specify strict: false. Problem solved.

Doctrine schema update always try to add NOT NULL

I have a fresh Symfony 2.8 installation, with doctrine and MySQL 5.6 stack.
After executing a doctrine:schema:update --force, i can see
Database schema updated successfully! "x" queries were executed
Here is my problem : Even if i execute it multiple time, doctrine always find schema differences.
With the --dump-sql, i can see that all of these queries are related to :
adding NOT NULL on string primary key
adding NOT NULL on datetime
field
However, when i check my database, these columns already have a NOT NULL.
Here is an example on a single property/column :
class MyEntity
{
/**
* #ORM\Id
* #ORM\Column(type="string", length=5, name="cd_key")
* #ORM\GeneratedValue(strategy="AUTO")
*/
private $code;
...
Here is the result of a SHOW CREATE TABLE my_entity; :
CREATE TABLE `my_entity` (
`cd_key` varchar(5) COLLATE utf8_unicode_ci NOT NULL,
`label` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`number` int(11) NOT NULL,
PRIMARY KEY (`cd_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;
And here the query doctrine try to execute with the doctrine:schema:update command :
ALTER TABLE my_entity CHANGE cd_key cd_key VARCHAR(5) NOT NULL;
I clean my Symfony cache between each command execution.
I try to add nullable=false on #Column annotation (event if it's already defined as an #Id), but no effect.
a doctrine:schema:validate don't find any mapping problem (except sync of course)
I try to drop and recreate the full database, but no effet.
Any ideas ?
This issue has been reported in 2017 at least here, here and here and supposed to be fixed by this PR.
Updating doctrine/dbal would be the solution (not working for me though):
$ composer require doctrine/dbal:^2.7.1
Unsetting the server version (mysql/mariadb) from the configuration would also fix the problem (still not for me though).
If one is using migrations he can still adjust them manually (but his schema will always be unsynced).
I've encountered a similar problem. For me deleting the table using SQL and then running again DOCTRINE:SCHEMA:UPDATE --FORCE worked for me.
It seems that doing some SQL requests manualy confuses Doctrine.
Saying that, i'm assuming you've put #ORM\Table(name="my_entity") and #ORM\Entity(repositoryClass="myrepository") over your class definition ;).
Hope it helped.

MySQL Strict: doesn't have a default value, still not working after adding a default value

I recently upgraded my local wampserver therefore updating MySQL. The strict mode as they have enabled by default is causing me some headaches.
The requirement to add default values (which is to me a little overdone. but who am I) is a big issue to me.
The system I created stopped working because of this grinding my entire operation to a halt.
The error I am getting :
: Field 'pageoptions_description' doesn't have a default value
Now I added a default value :
ALTER TABLE `serene_pageoptions`
CHANGE `pageoptions_description` `pageoptions_description`
TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;
However to no avail. Still getting the same error that the field does not have a default value. Default value is NULL. But this does not seem to be correct.
Is there anything I am missing?
I think the default value is always null, even if no default is defined. So your ALTER TABLE statement didn't really do anything. Saying that the default value is null is the same as having no default; it's not the same as saying that any missing values will be populated by nulls.
Here's a snap of one of the tables in my db, in which I haven't defined any defaults:
The default value is already null for every column. Can you think of another value that would make sense as a default for your column?

TYPO3 "Sorry, you didn't have proper permissions to perform this change."

I have a problem with Typo3.
I can add new pages, folders, etc via pagetree but i can't add, when i trying to do it i getting an error:
Sorry, you didn't have proper permissions to perform this change.
and second error in log
SQL error: 'Field 'filelink_sorting' doesn't have a default value' (tt_content:NEW) (msg#1.1.12)
Error showing when i choose content type (text/image/plugin/etc).
I have installed TemploViola and adding every content from account with admin permissions, on other accounts also getting error.
I found some fixes to it with ALTER TABLE pages ADD t3ver_swapmode tinyint(4) NOT NULL default '0'
but nothing changed after execute it in mysql.
Looks like the default definition is missing indeed for the field in TYPO3 6.2-dev LTS.
Please run ALTER TABLE tt_content MODIFY filelink_sorting tinytext default '' NOT NULL); in your database administration tool or change the definition at typo3/sysext/frontend/ext_tables.sql line 312 accordingly.