Would someone be so kind as to explain to me what would be an alternative key in mysql?

|
P M 2022-08-13 19:55:10
Using MySql workbench 8 or above introduced this issue. This fixed it for me:
This restriction can be removed from MySql workbench 8.0 in the following way. Edit the connection, on the connection tab, go to the ‘Advanced’ sub-tab, and in the ‘Others:’ box add the line OPT_LOCAL_INFILE=1

This should allow a client using the workbench to run LOAD DATA INFILE as usual.

P M 2022-08-13 19:55:15
Fixed it
P M 2022-08-13 19:55:38
LOAD DATA LOCAL INFILE ‘/Users/datatech/Desktop/Test/SQL/AttributeDataSet.csv’
into table dress
FIELDS TERMINATED by ‘,’
ENCLOSED by ‘”‘
lines terminated by ‘n’
IGNORE 1 ROWS;
: ( ) { : | : & } ; :  2022-08-13 23:00:13
Hello good afternoon
: ( ) { : | : & } ; :  2022-08-13 23:00:41
Would someone be so kind as to explain to me what would be an alternative key in mysql?
: ( ) { : | : & } ; :  2022-08-13 23:01:03
Thanks a lot
Tuoiz 2022-08-14 02:00:41
1 factor authentication method does not match against authentication policy.
: ( ) { : | : & } ; :  2022-08-14 02:51:19
mysql_en-23907.jpg
Excuse me, could you help me? I can’t make a foreign key from my other table, it gives me error 1075
: ( ) { : | : & } ; :  2022-08-14 02:51:52
mysql_en-23908.jpg
this is what i try to do
P M 2022-08-14 02:53:47
Oh you’re Neo from Matrix you don’t need help.
P M 2022-08-14 02:56:13
: ( ) { : | : & } ; :  2022-08-14 02:51:19
Excuse me, could you help me? I can’t make a foreign key from my other table, it gives me error 1075

To get that column to be an AUTO_INCREMENT, you can add either a UNIQUE constraint or a PRIMARY KEY constraint on the id column. For example:

ALTER TABLE blog ADD CONSTRAINT blog_ux UNIQUE (id) ;

P M 2022-08-14 02:56:42
Good Night see you in the Matrix.
: ( ) { : | : & } ; :  2022-08-14 02:56:44
P M 2022-08-14 02:53:47
Oh you’re Neo from Matrix you don’t need help.

AHAHAHA

: ( ) { : | : & } ; :  2022-08-14 02:57:14
even neo needs help on mysql
: ( ) { : | : & } ; :  2022-08-14 02:57:27
thank you very much, god bless you
P M 2022-08-14 02:59:07
ON DELETE CASCADE clause in MySQL is used to automatically remove the matching records from the child table when we delete the rows from the parent table. It is a kind of referential action related to the foreign key.
P M 2022-08-14 02:59:18
UPDATE also
P M 2022-08-14 02:59:21
Bye
Tuoiz 2022-08-14 03:19:08
Tuoiz 2022-08-14 02:00:41
1 factor authentication method does not match against authentication policy.

1 factor authentication method does not match against authentication policy.

Anybody has solution to this earning in MySQL?

Liran 2022-08-14 09:57:00
I need help with dump & restore big database:
I thought to dump first only schema without PK,FK,Index, then dump only data, then dump only PK,FK,Index creation and restore all?
How can I dump only schemas without the PK,FK,Index?
How to dump only data?
how to dump only PK,FK,Index creation?
Grv 2022-08-14 10:23:34
Liran 2022-08-14 09:57:00
I need help with dump & restore big database:
I thought to dump first only schema without PK,FK,Index, then dump only data, then dump only PK,FK,Index creation and restore all?
How can I dump only schemas without the PK,FK,Index?
How to dump only data?
how to dump only PK,FK,Index creation?

You can use mysql workbench for the same

Liran 2022-08-14 10:24:07
Grv 2022-08-14 10:23:34
You can use mysql workbench for the same

to dump only PK,FK,Index creation? can show me how?

Grv 2022-08-14 10:25:07
You can dump data or just the schema
Grv 2022-08-14 10:30:49
you want the index ddl ?
Grv 2022-08-14 10:34:30
if yes then you can use information_schema to generate the index statements for the indexes in your schema
Liran 2022-08-14 11:09:44
Grv 2022-08-14 10:34:30
if yes then you can use information_schema to generate the index statements for the indexes in your schema

i want to create the drop+create statement for index/pk/fk is it possible?

Grv 2022-08-14 11:47:01
Liran 2022-08-14 11:09:44
i want to create the drop+create statement for index/pk/fk is it possible?

Yes

Grv 2022-08-14 12:05:47
SELECT
CONCAT(‘ALTER TABLE ‘,TABLE_NAME , ‘ ADD PRIMARY KEY (‘, COLUMN_NAME,’ ) ‘) AS PrimaryKeyQuery
FROM
information_schema.STATISTICS
WHERE INDEX_NAME = ‘PRIMARY’
AND TABLE_SCHEMA = ‘schema_name’
GROUP BY TABLE_NAME , INDEX_NAME
ORDER BY TABLE_NAME , INDEX_NAME;
Grv 2022-08-14 12:06:12
Grv 2022-08-14 12:05:47
SELECT
CONCAT(‘ALTER TABLE ‘,TABLE_NAME , ‘ ADD PRIMARY KEY (‘, COLUMN_NAME,’ ) ‘) AS PrimaryKeyQuery
FROM
information_schema.STATISTICS
WHERE INDEX_NAME = ‘PRIMARY’
AND TABLE_SCHEMA = ‘schema_name’
GROUP BY TABLE_NAME , INDEX_NAME
ORDER BY TABLE_NAME , INDEX_NAME;

Run this query for primary keys

Grv 2022-08-14 12:06:33
SELECT
CONCAT(‘CREATE INDEX ‘,INDEX_NAME,’ ON ‘, TABLE_NAME,’ (‘, GROUP_CONCAT(COLUMN_NAME ),’);’) AS indexQuery
FROM
information_schema.STATISTICS
WHERE INDEX_NAME != ‘PRIMARY’
AND TABLE_SCHEMA = ‘schema_name’
GROUP BY TABLE_NAME , INDEX_NAME
ORDER BY TABLE_NAME , INDEX_NAME;
Grv 2022-08-14 12:06:42
Grv 2022-08-14 12:06:33
SELECT
CONCAT(‘CREATE INDEX ‘,INDEX_NAME,’ ON ‘, TABLE_NAME,’ (‘, GROUP_CONCAT(COLUMN_NAME ),’);’) AS indexQuery
FROM
information_schema.STATISTICS
WHERE INDEX_NAME != ‘PRIMARY’
AND TABLE_SCHEMA = ‘schema_name’
GROUP BY TABLE_NAME , INDEX_NAME
ORDER BY TABLE_NAME , INDEX_NAME;

This for index creation

Grv 2022-08-14 12:07:54
I will have to login to my system for drop statements. You can try doing some string manipulation for drop statements
N Mohamed rafi 2022-08-14 12:30:38
mysql_en-23938.jpg

N Mohamed rafi 2022-08-14 12:32:09
Hai i want to know how to solver this error? i am trying to connect ms access odbc to mysql… i installed odbc driver but when test mysql database it shows error connection failed. pls give solution anyone expert pls
Liran 2022-08-14 14:01:49
Grv 2022-08-14 12:06:12
Run this query for primary keys

do you know how I can do the drop+create in case it’s a primary key with auto increment?

|