Archiv für den Monat: November 2014

MySQL: Neuen User anlegen und einer Datenbank zuweisen (ohne GRANT)

– Neuen User anlegen
– alle Rechte zuweisen
– GRANT-Recht wieder entziehen
– Rechte schreiben/aktivieren (FLUSH)

Auf der mysql-Console muss dazu folgendes eingegeben werden:

CREATE USER 'typo3dev'@'localhost' IDENTIFIED BY 'thepassword';
GRANT ALL PRIVILEGES ON typo3dev.* TO 'typo3dev'@'localhost';
REVOKE GRANT OPTION ON typo3dev.* TO 'typo3dev'@'localhost';
FLUSH PRIVILEGES;

MySQL: Resync Replication

Mysql-Replication-Resync
> = Mysql
$ = User Shell
# = Root Shell

*** MASTER ***
>
RESET MASTER;
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;

#
mysqldump -uroot -p –all-databases > /a/path/mysqldump.sql

>
UNLOCK TABLES;

*** SLave ***

#

>
STOP SLAVE;

#
mysql -uroot -p < mysqldump.sql >
RESET SLAVE;
CHANGE MASTER TO MASTER_LOG_FILE=’mysql-bin.000001′, MASTER_LOG_POS=98

(Where the values of the above fields are the ones you copied before)

START SLAVE;
SHOW SLAVE STATUS;

(expected output:)
Slave_IO_Running: Yes
Slave_SQL_Running: Yes

///// OPTIONS FOR INNODB /////
–opt –single-transaction –comments –hex-blob –dump-date –no-autocommit –all-databases

—–
RESET SLAVE;
START SLAVE;