MySQL ERROR Unable to create or change a table without a primary key

When trying to restore a database backup to Managed DigitialOcean MySQL 8 database, i get following error

This is because one of the tables in your MySQL backup don’t have primary key defined. Solution There are few ways you can fix this. Proper way is to define a primary key for the table. If […]

Read More…

ERROR 1118 Row size too large Changing some columns to TEXT or BLOB may help.

When restoring a MySQL database, i get error

I installed exactly same MraiaDB version on both source and destination server. But still restring failed. This is due to default Engine. On old server, i had

On new server, it had InnoDB was set as default.

Solution Edit the SQL file in a […]

Read More…

MariaDB ERROR 1524 Plugin unix_socket is not loaded

After upgrading MariaDB on Ubuntu server, i got following error

Users created worked fine. Only root user had this error. To fix, you need to enable auth_socket.so plugin. Edit file

Find

Add below

Resatrt MariaDB

See MySQL […]

Read More…

MySQL Database Character Set and Collation

MySQL

To change MySQL database char set and collation, run

To usee current char set and collation, run

You can specify char set when creating database with following syntax

[…]

Read More…

MySQL ERROR 1193 Unknown system variable GTID_PURGED

MySQL

When restoring MySQL backup taken on Amazon RDS, i get error

To fix this, open db.sql in text editor, remove the line

Another solution is take a new MySQL backup with –set-gtid-purged=OFF option and restore it.

[…]

Read More…

MySQL create database

To create a database, you can use

Example To create a database with specific charset use

You can use whatever character set you wish instead of utf8mb4. Example

To delete a database, use

[…]

Read More…

MySQL 8

MySQL

MySQL 8 use caching_sha2_password as default autentication method. Many mysql clients still not support this method. If you need to use old method, you can set autentication plugin as mysql_native_password. You can also set this as default method by editing my.cnf file.

To change a user to use mysql_native_password, run

[…]

Read More…