HacksLinux SysAdmin Notes
Use one of the following commands to run a MySQL query from a Linux Command Line or a Bash Script.
Creating MySQL Database from the command line is quite a common task.
We'll create database named test_db with a user named john and a password pass.
User will have all privileges on this database and will be allowed to connect only from the localhost.
MySQL is the world's most popular open source relational database management system that runs as a server providing multi-user access to a number of databases.
This guide explains how to install and perform the initial secure configuration of MySQL Server on CentOS/RHEL based systems.
Changing a MySQL user's password is a task handled by the database administrator (root).
Once the MySQL user's password is changed, you should update the user's privileges.
Do not use phpMyAdmin to restore your MySQL database if the MySQL database is large.
phpMyAdmin has limit on total upload size and, there is also maximum execution time which may cause browser to time out.
The solution of how to restore large MySQL database from the sql dump file is to use Linux/Unix command line.
The basic installation of MySQL Server provides a great command line utility to take backup of MySQL databases.
The 'mysqldump' command is used for creation "dumps" of databases managed by MySQL.
These dumps are just files with all the SQL commands needed to recreate the database.
The most common task when managing a replication process is to ensure that the replication is taking place and that there have been no errors between the slave and the master.
The primary statement for this is 'SHOW SLAVE STATUS', which you must execute on each slave.
Copyright © 2011-2015 Shell Hacks - Linux Howtos and Tutorials