Tag Archives: Database

What to be aware before importing MariaDB .sql into a MySQL database? – Databases – SitePoint Forums

Hello, layman here. Having MariaDB database (v. 10.6.18) on a shared hosting.
If my new hosting provider has no MariaDB but MySQL and I will be importing using PHPMyAdmin, how to spot the issues?

https://blogs.oracle.com/mysql/post/how-to-migrate-from-mariadb-to-mysql-80 says:
“Before migration (from MariaDB to MySQL), you will need to convert data in other storage engines to InnoDB”

List storage engines (SQL tab of the PHPMyAdmin):

SELECT COUNT(*) as '# TABLES', 
  CONCAT(ROUND(sum(data_length) / ( 1024 * 1024 * 1024 ), 2), 'G') DATA,
  CONCAT(ROUND(sum(index_length) / ( 1024 * 1024 * 1024 ), 2), 'G') INDEXES,
  CONCAT(sum(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2)), 'G') 'TOTAL SIZE', ENGINE 
FROM information_schema.TABLES
WHERE TABLE_SCHEMA 
 ...

Source link

How to create a connection to Database using go lang | by Achmad Fatoni | Jan, 2024

In the steps above we have created a database and table that we will use to connect using Go Lang. The next step is to create a service and configure it to connect to the database that was created previously. Here are the steps:

1. First initiate our project using the following command:

go mod init [nama project]

# example
go mod init test-connection-db

2. Because here I am using MySQL as the database, here we need to add the MySQL driver package.

go get github.com/go-sql-driver/mysql

3. Next, we setup the database connection by creating a new file called connection/database.go. Paste the following code :

package connection

import (
"database/sql"
"time"

_ "github.com/go-sql-driver/mysql"
)

func GetConnection() *sql.DB {
// username = root
// password = admin
// host = 127.0.0.1
// db name =...


Source link