Robert Harker Technical Wiki
Thoughts and Ideas About Large Sites

[ Prev ] [ Index ] [ Next ]


MySQL

TOPIC

Mysql configuration

# Install mysql
yum install mysql mysql-server
yum install mysql-utilities mysql-workbench mysqltuner

# Enable mysqld
systemctl enable mysqld.service
systemctl start mysqld.service
systemctl status mysqld.service

# Secure mysqld
girl nsp hr
/usr/bin/mysql_secure_installation

# Configure mysql to listen to the network

# Configure iptables to allow mysqld

# Login to mysql
mysql -u root -h localhost -p
mysql -u root -h science -p

# Notes:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h nova2.cloud5.harker.com password 'new-password'

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

# Dump databases
mysqldump -u root -p --all-databases --events > mysql.init.sql

mysqldump -u root -p [database_names] > dumpfilename.sql

# Restore
# create database database in mysql
mysql -u root -p [database_name] < dumpfilename.sql

# Replicate
mysqldump -u root -p [database_name] | \

mysql -u root -p --host=remote-server -C [database_name]

Create database and user
CREATE DATABASE [database_name]
GRANT ALL ON [database_name].* TO 'harker'@'%' IDENTIFIED BY 'girl';
How to flush privleges

How to Check and Repair MySQL Tables Using Mysqlcheck
http://www.thegeekstuff.com/2011/12/mysqlcheck/

MySQL Tutorial: Install, Create DB and Table, Insert and Select Records
http://www.thegeekstuff.com/2011/10/mysql-tutorial-basics/

# How To: 5 Steps to Install phpMyAdmin on Linux
http://www.thegeekstuff.com/2010/09/install-phpmyadmin/

# 15 SQLite3 SQL Commands Explained with Examples
http://www.thegeekstuff.com/2012/09/sqlite-command-examples/


Backlinks: index Start
Created with Zim desktop wiki