SET @database = "kenzasto_db";

SET @charset = "utf8mb4";

SET @collate = "utf8mb4_general_ci";

SELECT "SET foreign_key_checks = 0;"
UNION ALL
SELECT concat(
"ALTER DATABASE `",
SCHEMA_NAME,
"` CHARACTER SET = ",
@charset,
" COLLATE = ",
@collate,
";"
) AS sql
FROM information_schema.SCHEMATA
WHERE SCHEMA_NAME = @database
AND (
DEFAULT_CHARACTER_SET_NAME <> @charset
OR DEFAULT_COLLATION_NAME <> @collate
)
UNION ALL
SELECT concat(
"ALTER TABLE `",
TABLE_SCHEMA,
".",
TABLE_NAME,
"` CONVERT TO CHARACTER SET ",
@charset,
" COLLATE ",
@collate,
";"
) AS sql
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = @database
AND TABLE_TYPE = "BASE TABLE"
AND TABLE_COLLATION <> @collate
UNION ALL
SELECT concat(
"ALTER TABLE `",
c.TABLE_SCHEMA,
".",
c.TABLE_NAME,
" CHANGE ",
c.COLUMN_NAME,
" ",
c.COLUMN_NAME,
"` ",
c.COLUMN_TYPE,
" CHARACTER SET ",
@charset,
" COLLATE ",
@collate,
if(c.IS_NULLABLE="YES", " NULL", " NOT NULL"),
";"
) AS sql
FROM information_schema.COLUMNS c,
information_schema.TABLES t,
information_schema.COLLATION_CHARACTER_SET_APPLICABILITY a
WHERE c.TABLE_SCHEMA = t.TABLE_SCHEMA
AND c.TABLE_NAME = t.TABLE_NAME
AND t.TABLE_COLLATION = a.COLLATION_NAME
AND c.TABLE_SCHEMA = @database
AND c.DATA_TYPE IN (
'varchar',
'char',
'text',
'tinytext',
'mediumtext',
'longtext'
)
AND (
c.CHARACTER_SET_NAME <> a.CHARACTER_SET_NAME
OR c.COLLATION_NAME <> t.TABLE_COLLATION
)
AND t.TABLE_TYPE = "BASE TABLE"
UNION ALL
SELECT "SET foreign_key_checks = 1;";

#collation #set #charset #mysql #database #data #base
PR untuk Sistem Qurban ke depannya.

» DIawal entry-an qurban harus di Fix kan Form Validation. Artinya semua field dan semua error yang mungkin terjadi seperti escape quote harus dipersiapkan sebelum entry an masuk kepada database. Jadi semua entrian yg masuk ke database adalah data yg sudah fix atau terbebas dari semua jenis error

#pr #peer #sistem #qurban #quote #form #validation #data #fix #noerror #error #entry #escape #newline #form #sanitation #character #string #enter #avoid #sistem #qurban
Adding dummy blog posts to WordPress can help you test layouts, themes, or plugins. You can do this manually or by importing pre-made content. Here's how to achieve both methods:

---

## Method 1: Manually Add Dummy Blog Posts
1. Log in to WordPress Admin:
- Navigate to <your-site-url>/wp-admin.

2. Go to Posts:
- In the admin sidebar, go to Posts -> Add New.

3. Create a Dummy Post:
- Title: Add a title like "Sample Post" or "Test Blog Post."
- Content: You can enter placeholder text, such as "Lorem ipsum dolor sit amet..." or copy it from [this source](https://www.lipsum.com/).

4. Set Featured Image (Optional):
- In the Featured Image section, upload a placeholder image for testing.

5. Add Categories and Tags:
- On the right, add Categories or Tags to organize your posts.

6. Publish the Post:
- Click Publish to make the post live.

7. Repeat:
- Create more dummy posts for thorough testing (e.g., 5–10 posts with different content and images).

---

## Method 2: Import Pre-Made Dummy Content (Recommended)

1. Download Dummy Data:
- You can use the official WordPress Theme Unit Test Data file, which contains multiple posts, pages, comments, categories, and tags:
- Download the XML file from:
[Theme Unit Test Data](https://raw.githubusercontent.com/WPTT/theme-unit-test/master/themeunittestdata.wordpress.xml).

2. Import the Dummy Data:
- In your WordPress admin panel, go to Tools -> Import.
- Scroll down and choose WordPress. If it’s not installed, click Install Now to install the WordPress importer.

3. Upload the XML File:
- Once the importer is installed, click Run Importer.
- Upload the themeunittestdata.wordpress.xml file you downloaded earlier.

4. Assign Author:
- During the import process, you’ll be asked to assign the posts to an author. You can assign them to an existing user or create a new one.

5. Import Attachments:
- Check the box to Download and import file attachments (this imports the images).

6. Finish Import:
- Click Submit to complete the import. The imported content will now appear in Posts -> All Posts.

---

## Method 3: Use a Plugin to Generate Dummy Content

1. Install FakerPress Plugin:
- In the WordPress admin panel, go to Plugins -> Add New.
- Search for FakerPress and click Install Now -> Activate.

2. Generate Dummy Content:
- Go to FakerPress -> Posts.
- Configure the settings (number of posts, categories, tags, images, etc.).
- Click Generate to create dummy posts.

---

## Summary:
- Manual Method: Add individual posts with placeholder content.
- XML Import: Use the Theme Unit Test Data for quick bulk import.
- FakerPress Plugin: Automatically generate posts with realistic dummy data.

These methods allow you to create test posts to evaluate the appearance and functionality of your WordPress site.

#dummy #data #fake #faker #plugin #wp #wordpress #oxygen
In simple terms, mysqldump-secure is a tool designed to create backups of your MySQL databases in a secure and automated way. It enhances the regular mysqldump utility by focusing on security, organization, and automation.

Here’s what it does:

1. Secure Backups:
- Ensures sensitive data like database credentials is protected.
- Uses strict permissions for configuration and backup files to prevent unauthorized access.

2. Automated Management:
- Automatically organizes backups into directories for better structure.
- Can compress backups to save space and remove old backups based on a retention policy.

3. Focus on Security:
- Forces strict file permissions so only authorized users can access the backups.
- Prevents accidental exposure of sensitive data.

4. Optional Encryption:
- It can encrypt the backups to add an extra layer of protection.

5. Easier Maintenance:
- Includes logging for errors and warnings.
- Provides options to test configurations and ensure backups are reliable.

In short, mysqldump-secure is like a safer and smarter version of the default mysqldump, ideal for securely backing up MySQL databases.


#mysql #dump #mysqldump-secure #data #base #mariadb #database #backup #mysqldump #mariadb
To use mysqldump-secure for managing database backups, including proper dependency handling of views, follow these steps:

---

### 1. Install `mysqldump-secure`
mysqldump-secure is an open-source tool available on GitHub. You need to install it manually.

#### Step 1.1: Download mysqldump-secure
Clone the repository from GitHub:

git clone https://github.com/cytopia/mysqldump-secure.git
cd mysqldump-secure


#### Step 1.2: Run the Installer Script
Run the installation script to set up the tool:

sudo ./install.sh


Alternatively, you can manually copy the mysqldump-secure script into your /usr/local/bin/ directory for global usage.

---

### 2. Configure `mysqldump-secure`
After installation, configure mysqldump-secure to meet your backup needs.

#### Step 2.1: Edit the Configuration File
Edit the mysqldump-secure.conf file located at /etc/mysqldump-secure.conf:

sudo nano /etc/mysqldump-secure.conf


Key options to configure:
- User and Password: Set up a dedicated MySQL user for backups with restricted permissions.
- Storage Directory: Define the directory where backups will be stored.
- Compression: Enable compression to save storage space.
- Retention: Configure how many backups to keep.

---

### 3. Back Up Your Database

Run mysqldump-secure to back up your database. It automatically handles dependencies between views and tables.

#### Backup a Specific Database
mysqldump-secure -d database_name


#### Backup All Databases
mysqldump-secure -A


#### Backup Specific Tables or Views
If you only want to back up certain tables or views, specify them:

mysqldump-secure -d database_name -t table_name


---

### 4. Restore the Backup

mysqldump-secure organizes backups into structured directories, which makes restoring specific tables, views, or databases straightforward.

#### Locate the Backup File
Navigate to the backup directory (default: /var/backups/mysqldump-secure) and identify the backup file.

#### Restore the Backup
To restore the backup, use the standard mysql command:

mysql -u username -p database_name < /path/to/backup.sql


---

### Features That Make `mysqldump-secure` Better

1. View Dependency Management:
- The tool automatically ensures that views are dumped in the correct order based on their dependencies, avoiding issues during restoration.

2. Customizable Configuration:
- Full control over options like compression, encryption, storage paths, and more.

3. Safety Features:
- Automatically handles edge cases, such as databases with circular dependencies.

4. Retention Policies:
- Automatically removes old backups to save storage space.

---

### 5. Troubleshooting and Advanced Features

#### Test the Backup
After creating the backup, test it by restoring it to a test environment:

mysql -u username -p test_database < /path/to/backup.sql


#### Log Files
Check the log files for errors or warnings during the backup process. Logs are usually stored in /var/log/mysqldump-secure.log.

---

### Example Workflow

Here’s a typical workflow for using mysqldump-secure:

1. Backup All Databases Daily
Add a cron job to automate daily backups:
   crontab -e

Add the following line to run the backup every day at midnight:
   0 0 * * * /usr/local/bin/mysqldump-secure -A


2. Check Backups
Verify backups regularly to ensure they’re complete and restorable.

---

### Where to Learn More
Visit the official GitHub page for full documentation:
[https://github.com/cytopia/mysqldump-secure](https://github.com/cytopia/mysqldump-secure)

#mysql #dump #mysqldump-secure #data #base #mariadb #database #backup #mysqldump #mariadb