mysql

Percona

Fix: safe_to_bootstrap: 1

# search for node with "safe_to_bootstrap: 1"
cat /var/lib/mysql/grastate.dat
 
killall mysqld
service mysql bootstrap-pxc
#/etc/init.d/mysql bootstrap-pxc
service mysql start
killall -9 mysqld
cat /var/lib/mysql/grastate.dat
mysqld_safe --wsrep-recover
service mysql status
 
service mysql start --wsrep-new-cluster
tail -f /var/log/mysqld.log
 
# n-th hosts
service mysql start
 
 
 
sed -i "/safe_to_bootstrap/s/0/1/" /var/lib/mysql/grastate.dat
 
https://www.percona.com/doc/percona-xtradb-cluster/LATEST/howtos/crash-recovery.html
# https://severalnines.com/blog/updated-how-bootstrap-mysql-or-mariadb-galera-cluster
killall -9 mysqld
cat /var/lib/mysql/grastate.dat
mysqld_safe --wsrep-new-cluster
service mysql restart
 
# restart start on remaining nodes
 
cat /var/lib/mysql/gvwstate.dat

Get cluster status

Connect to MySQL DB

# ubuntu package
sudo apt-get install -y libmysql-java

path: /usr/share/java/mysql-connector-java.jar

# download
wget http://ftp.gwdg.de/pub/misc/mysql/Downloads/Connector-J/mysql-connector-java-5.1.12.tar.gz -P /tmp

# extract
tar xzf /tmp/mysql-connector-java-5.1.12.tar.gz -C /tmp/

# copy to your classpath
cp /tmp/mysql-connector-java-5.1.12/mysql-connector-java-5.1.12-bin.jar ~/NetBeansProjects/classpath/

# Netbeans
add Library / Jar File
select
~/NetBeansProjects/classpath/mysql-connector-java-5.1.12-bin.jar

# create tatabase
create database java;

MySQL / MariaDB Database

Login
mysql -u root -p

Optimize all databases
mysqlcheck --optimize --all-databases --host=localhost --user=${DB_USER} --password=${DB_PASS}

Links
phpMyAdmin - phpMyAdmin downloads

GUI
apt-get install -y mysql-admin

Allow access from outsice
sed -i 's|bind-address|#bind-address|g' /etc/mysql/my.cnf
/etc/init.d/mysql restart

Allow access to database magento for user dbo_magento from any host