MySQL Hoofdpagina

Exporteer alle Databases

root@gw-famnet# mysqldump --user=XXXXXXXX --password=XXXXXXX -A > /PATH/TO/DUMPFILE.SQL

Exporteer meerdere databases

root@gw-famnet# mysqldump --user=XXXXXXXX --password=XXXXXXX --databases DB_NAME1 DB_NAME2 DB_NAME3 > /PATH/TO/DUMPFILE.SQL

Exporteer sommige tabellen

root@gw-famnet#mysqldump --user=XXXXXXXX --password=XXXXXXXX --databases DB_NAME --tables TABLE_NAME > /PATH/TO/DUMPFILE.SQL

Exporteer 1 database

Standaard SQL (platte tekst)

root@gw-famnet# mysqldump --user=databasegebruikersnaam --password=wachtwoord --databases databasenaam > /PATH/TO/bestandsnaam.sql

Als XML bestand (platte tekst)

root@gw-famnet# mysqldump --user=databasegebruikersnaam --password=wachtwoord --databases databasenaam --xml > /PATH/TO/bestandsnaam.**xml**

Gezipt XML bestand

root@gw-famnet# mysqldump --user=databasegebruikersnaam --password=wachtwoord --databases databasenaam --xml | gzip -9 > /PATH/TO/bestandsnaam.gz

Create database

root@gw-famnet# mysql -u root -p
mysql> CREATE DATABASE cms;

Create database user

Aanmaken van een user met verschillende mogelijkheden

mysql> CREATE USER 'gebruiker' IDENTIFIED BY 'wachtwoord'; = inclusief de '
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on databasenaam.* to gebruiker@localhost; "user mag alles in de tabellen van deze database"
Query OK, 0 rows affected (0.02 sec)

mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%' WITH GRANT OPTION; "user mag alles op elke db en table, incl. toekennen van opties, en dat vanaf elke machine"

see http://dev.mysql.com/doc/refman/5.1/en/adding-users.html

Importeer database

root@gw-famnet# mysql -u #username# -p #database# < #dump_file#

Backup cmsms site

tar -czvf cmsms-website.tgz --absolute-names --preserve-permissions --preserve-order /var/www/cmsms

Database naam en user vervangen

CMSMS : in het config.php file
#-----------------
#Database Settings
#-----------------
#This is your database connection information. Name of the server,
#username, password and a database with proper permissions should
#all be setup before CMS Made Simple is installed.
$config['dbms'] = 'mysql';
$config['db_hostname'] = 'localhost';
$config['db_username'] = 'username';
$config['db_password'] = 'password';
$config['db_name'] = 'databasename';
#Change this param only if you know what you are doing
$config["db_port"] = '';

Wijzig in het MySQL dumpfile.sql

\--
\-- Current Database: `artwam`
\--
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `artwam` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `artwam`;

Backup CMS

Backup CMS

WordPress Perikelen

URL problemen in de MySQL database

WordPress Perikelen

/usr/syno/mysql/bin/mysql -u root