mysql

Migrating my old mysql blog database to a new blog software (PluggedOut)

We updated my server from SuSE 9.3 to 10.1. php5 is the default on 10.1 and my blog software broke. As my blog software is not anymore maintained, I had to switch to another and I selected PluggedOut. The mysql database structures were quite different and this is what I did to do the conversion:

First I dumped the old database into textfiles:

mysqldump -u root -p --tab=/home/jeltsch/temp --fields-terminated-by=| --lines-terminated-by=# journal

How to backup mysql databases (mysqlhotcopy, mysqldump)

There are different possibilities. If you have access to the machine where mysql is running, you should use:
mysqlhotcopy On our RedHat 8 server you just type:
/usr/bin/mysqlhotcopy --user=root --password=sdjksjd journal /path/to/backup/directory Alternatively:
/usr/local/mysql/bin/mysqldump --user=username -p phpgedview >phpgedview The path of the command is specific for the mysql install on a MacOS X machine.

Adding a new user to MySQL and other basic mysql commands

Crontab entry to backup all mysql databases to a file every midnight:
0 0 * * * mysqldump -u mjeltsch -h localhost --all-databases | gzip -9 > /home/mjeltsch/Documents/mysqldump.gz > /dev/null

Granting privileges to users connecting from localhost:
GRANT ALL PRIVILEGES ON *.* TO 'michael'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

Granting privileges to users connecting from everywhere:
GRANT ALL PRIVILEGES ON *.* TO 'michael'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

Pages