MySQL & MariaDB
Get help with MySQL and MariaDB Database Servers. AGIX Linux staff have the know-how and experience to help your organization with Database Server best-practices, current technology in various Cloud environments including Amazon AWS.
This page shows examples of our work that AGIX Linux shares freely with you. For a fully supported compute environment, contact our team to find out how we can help your organization move forward in the right way.
See Our Blogs on MySQL & MariaDB
Import data into AWS’s MySQL – clean it first
All HowTo's
MySQL & MariaDB
You’ve dumped a DB from MySQL and didn’t use the “–no-triggers” option. Now you’re trying to import your data into RDS MySQL which complains that: ERROR 1227 (42000) at line xxx: Access denied; you need (at least one of) the SUPER privilege(s) for this operation You can solve this by
Read More
How to find where MySQL puts error logs
All HowTo's
MySQL & MariaDB
MySQL will use the “/etc/my.cf” file to learn where to put its error log file. However, if you don’t specify it, you don’t have access to the filesystem or you’re simply confused, try this. First log into MySQL and then run the following: mysql> show global variables like 'log_error'; +---------------+--------------------------------------+
Read More
Dump and Backup all MySQL Databases into their own files
All HowTo's
Cyber-Security
MySQL & MariaDB
Scripting in Bash
This article demonstrates how to backup all MySQL databases into their own files and then tar the lot including system files. #!/bin/bash TO="/root" FROM="/etc /var/www/html /var/backups" DBUSER="root" DBPASS='MyPassword' THISHOST=`hostname` DBLIST=`echo "show databases;" | mysql --password=$DBPASS -u $DBUSER | egrep -v '^Database$|^information_schema$|^mysql$'` for DBLOOP in `echo $DBLIST` do mysqldump -u $DBUSER
Read More
Restore a single MySQL DB from a Dump using –all-databases
All HowTo's
MySQL & MariaDB
The link below shows a simple way to restore one the MySQL database that you want from a dump that included all databases. Extracting a Database From a mysqldump File The good people who wrote that article (can) take credit for the following: shell> sed -n '/^-- Current Database: `mydb`/,/^--
Read More
Install a MySQL client for Mac
Apple MacOS
MySQL & MariaDB
Actually there are several to choose from. We’ll go with “Sequel” for this tutorial. Download it from here: https://sequel-pro.googlecode.com/files/sequel-pro-1.0.2.dmg The Sequel is a GUI based tool but still allows you to run queries, browse data, etc.
Read More
Interacting with MySQL using PHP with OpenShift
All HowTo's
MySQL & MariaDB
This article shows how to use PHP to access a database from within OpenShift. In this case the PHP code is accessing the MySQL database within the same application. function db_connect() { $db_username = getenv('OPENSHIFT_MYSQL_DB_USERNAME'); $db_password = getenv('OPENSHIFT_MYSQL_DB_PASSWORD'); $db_host = getenv('OPENSHIFT_MYSQL_DB_HOST') . ":" . getenv('OPENSHIFT_MYSQL_DB_PORT'); $db_name = "mydbname"; $conn =
Read More
Populating MySQL Within OpenShift
All HowTo's
MySQL & MariaDB
This document explains how to populate a MySQL database within OpenShift. In this example we have an application with three gears; HAProxy, PHP and MySQL. We have RHC configured. We have the SQL dump file available via http but it could be by ftp or ssh. First we connect to
Read More
Get the size of MySQL databases
All HowTo's
MySQL & MariaDB
This is a one-liner that will show you the size of your MySQL databases. This works for RDS MySQL databases. Having logged into your MySQL server as the root user: SELECT table_schema "Database Name", sum( data_length + index_length ) / 1024 / 1024 "Database Size in MB" FROM information_schema.TABLES GROUP
Read More
Reset a lost MySQL Password on CentOS and Redhat Linux
All HowTo's
Cyber-Security
Linux
MySQL & MariaDB
Redhat, Fedora and CentOS Linux
Use these instructions to reset a lost MySQL root password. I’ve taken these steps from the website “http://www.rackspace.com/knowledge_center/article/mysql-resetting-a-lost-mysql-root-password”. All credit to them. Note that this is done as the ‘root’ user. First stop MySQL and start it in ‘safe mode’: service mysqld stop mysqld_safe --skip-grant-tables & Now login without the
Read More
Create a new MySQL user, grant permissions and set the password in one command
All HowTo's
MySQL & MariaDB
This one-liner shows how to create a new MySQL user, grant permissions and set the password: GRANT ALL PRIVILEGES ON mydb.* To 'myuser'@'%' IDENTIFIED BY 'mypassword'; Then run: FLUSH PRIVILEGES And that’s it.
Read More
Need Help?
Click Here