← Back to knowledge

Databases

How to install MySQL on Ubuntu

Install the latest MySQL on Ubuntu, secure it, and create your first database and user — the right way, from the official MySQL repository.

30 June 2026 Databases

MySQL max_allowed_packet: packet too large

This error means a single query or row exceeded the maximum packet size MySQL accepts. It shows up most often when importing a large dump or storing big blobs.

23 June 2026 Databases

MySQL ERROR 1205: Lock wait timeout exceeded

This error means a transaction waited too long for a row lock held by another transaction and gave up. Usually a long-running or stuck transaction is holding the lock.

23 June 2026 Databases

MySQL ERROR 1040: Too many connections

This error means MySQL hit its max_connections limit and is refusing new clients. Raise the limit if it is genuinely too low, but first rule out leaked connections.

23 June 2026 Databases

MySQL ERROR 1698: Access denied for user 'root'@'localhost'

On a fresh Ubuntu install, logging into MySQL as root fails even with the right password. The cause is the auth_socket plugin, not a wrong password.

23 June 2026 Databases

SQLSTATE[23000] 1062 Duplicate entry

This MySQL error means you tried to insert or update a row with a value that already exists in a unique or primary key column. It is an integrity constraint doing exactly its job.

23 June 2026 Databases

MySQL ERROR 2006: server has gone away

This error means the connection to MySQL was lost mid-query. The usual causes are an idle timeout, a query larger than max_allowed_packet, or the server restarting.

23 June 2026 Databases

MySQL ERROR 1064: SQL syntax error

Error 1064 means MySQL could not parse your query. The message points at exactly where parsing failed, the cause is usually a reserved word, a typo, or a quoting problem.

23 June 2026 Databases

SQLSTATE[HY000] [1045] Access denied for user

This MySQL error means the username, password or host your application uses to connect is wrong, or the user has no privileges on the database. It is the most common database connection error there is.

23 June 2026 Databases

SQLSTATE[42S02] Base table or view not found

This MySQL error means your query references a table that does not exist in the connected database. In Laravel it almost always means migrations have not run, or you are connected to the wrong database.

23 June 2026 Databases

SQLSTATE[HY000] [2002] Connection refused

This error means your application could not even reach the MySQL server. Unlike access denied, the credentials were never checked, the host or port is wrong or the database is not running.

23 June 2026 Databases

How to rename a MySQL database

Unlike renaming a table, you can't rename a database in MySQL sadly enough. So there is no SQL query you can execute to achieve this. However, it is possible with a workaround.

24 September 2024 Databases

Import MySQL database without timezone difference

When you import a MySQL database from a server to your local computer, you might notice that the dates and times are different.

2 May 2024 Databases

How to install PostgreSQL with pgvector on Ubuntu

Turn PostgreSQL in a vector database using the pgvector extension on Ubuntu 22.

2 December 2023 Databases

How to upgrade MySQL 5.7 to 8.0 on Ubuntu

Learn how to safely upgrade your database server from MySQL 5.7 to MySQL 8.0 on Ubuntu.

12 January 2023 Databases

Backup MySQL databases in separate files

How to dump existing MySQL databases on a server in separate backup files.

12 January 2023 Databases

Backup MySQL databases in single file

How to dump existing MySQL databases on a server in a single file.

12 January 2023 Databases

Backup MySQL databases except system databases in a single file

How to dump all MySQL databases on a server in a single file with the exception of certain (system) databases.

12 January 2023 Databases

Importing database in MySQL using command line

Importing a database in MySQL is quick & easy using the command line.

30 August 2022 Databases

Export MySQL database using command line

Exporting a MySQL database is a task you will need very often when working with databases.

30 August 2022 Databases

Stream MySQL backup directly to S3 bucket

Backing up your database is very important. Creating a backup in the most efficient way is essential when you do not have unlimited disk space.

24 August 2022 Databases