To check if MariaDB/MySQL databases are empty in your DB Server, run the following query: 1MariaDB [(none)]> SELECT table_schema, # "DB Name", 2-> Round(Sum(data_length + index_length) / 1024 / 1024, 1) # "DB Size in MB" 3-> FROM information_schema.tables 4-> GROUP BY table_schema; …
Read MoreMySQL/MariaDB with Credentials File
2020-05-12 · 1 min read · mysql mariadb authentication permission credentials credentials-file mysql-security ·Using a configuration file for mysql is a good practice as you don't immediately expose credentials. Below, you are going to mysql cli and immediately using the db named dbName. 1mysql --defaults-file=/path/to/credentials.ini dbName where credentials.ini has this format: 1[client] …
Read MoreObserved this in Mariadb 10.x versions. Despite being able to change password, it is still ignoring the password. Non-root user not affected. Explanation per https://mariadb.com/kb/en/authentication-from-mariadb-104/ Using unix_socket means that if you are the system root user, you can login as root@locahost without a …
Read MoreMariaDB seems to have this issue and can't start as shown in /var/log/mariadb/mariadb.log 12020-02-19 15:18:49 0 [ERROR] mysqld: Can't create/write to file '/var/run/mariadb/mariadb.pid' (Errcode: 2 "No such file or directory") I was able to fix one instance of this issue by doing: 1sudo mkdir …
Read MoreUse the query below and replace "database_name" with the correct db name. 1SELECT table_name AS "Table", 2ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" 3FROM information_schema.TABLES 4WHERE table_schema = "database_name" 5ORDER BY (data_length + index_length) …
Read MoreBest way is to make one file per table and not use default which baloons to a huge file and never shrinks when some tables are removed and unused. See https://www.thegeekstuff.com/2016/02/mysql-innodb-file-per-table Some other reference: …
Read More1mysqldump -u<username> -p<password> --no-create-db myDB --ignore-table=myDB.table1 --ignore-table=myDB.table3-h localhost > mysql.backup See https://tecadmin.net/tutorial/mysql/skip-tables-in-mysqldump/
Read More1slow_query_log = 1 2long_query_time = 1 3slow_query_log_file = /var/log/mariadb/slow-query.log 4log_queries_not_using_indexes See details in https://www.cyberciti.biz/faq/how-to-set-and-enable-mariadb-slow-query-log-linux-unix/
Read More