April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

MySQL master-slave and proxy server

MySQL master-slave principle and process

principle

MySQL Replication is an asynchronous replication process (mysql5.1.7 or later is divided into asynchronous replication and semi-synchronous modes), copied from a Mysql instace (we call it Master) to another Mysql instance (we call it Slave) . Implementation of the Master and Slave The entire replication process is mainly done […]

MySQL: Calculate the free space in IBD files

If you use MySQL with InnoDB, chances are you’ve seen growing IBD data files. Those are the files that actually hold your data within MySQL. By default, they only grow — they don’t shrink. So how do you know if you still have free space left in your IBD files?

There’s a query you can […]

mysql dump issue utf8_unicode_520_ci

i use this in linux :

sed -i ‘s/utf8mb4/utf8/g’ your_file.sql sed -i ‘s/utf8_unicode_ci/utf8_general_ci/g’ your_file.sql sed -i ‘s/utf8_unicode_520_ci/utf8_general_ci/g’ your_file.sql

then restore your_file.sql

mysql -uyourdbuser -pyourdbpasswd yourdb < your_file.sql […]

How to reset your root MySQL password

Stop the MySQL process # service mysqld stop Once MySQL has stopped, restart it with the –skip-grant-tables option # mysqld_safe –skip-grant-tables & or edit your /etc/my.cnf file to add the line skip-grant-tables Connect to MySQL using the root user. mysql -u root Once logged in, you should see the following prompt: mysql> Enter the following […]

NoSQL vs SQL comparison

NoSQL vs SQL comparison

The following table compares the main differences between NoSQL and SQL.

 

Full understanding of the new features of MySQL 8.0

Full understanding of the new features of MySQL 8.0

First, the function added in MySQL 8.0

1, the new system dictionary table

Integrated transaction data dictionary for storing information about database objects, all metadata is stored using the InnoDB engine

2, support for DDL atomic operations

The DDL of the InnoDB table supports transaction integrity, […]

Mysql backup

#!/usr/bin/env bash USER=”” PASSWORD=”” OUTPUTDIR=”” DAYS_TO_KEEP=60 databases=`mysql -u$USER -p$PASSWORD -e “SHOW DATABASES;” | tr -d “| ” | grep -v Database` cd $OUTPUTDIR for db in $databases; do if [[ “$db” != “information_schema” ]] && [[ “$db” != “performance_schema” ]] && [[ “$db” != “mysql” ]] && [[ “$db” != _* ]] ; then echo […]

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

Create a user in Mysql in linux

login to mysql as a root

mysql -u root -p

now create user with following command

CREATE USER ‘testdb’@’localhost’ IDENTIFIED BY ‘test123’;

if you got error like below.

then you have to […]

MySQL Slave Failed to Open the Relay Log

This problem is a little tricky, there are possible fixes that MySQL website has stated. Sad to say, the one’s I read in the forum and site didn’t fix my problem. What I encountered was that the relay-bin from my MySQL slave server has already been ‘rotated’, meaning deleted from the folder. This happens when […]

Installing MariaDB on CentOS Linux 7.5

MariaDB is an open source relational database management system that is backwards compatible and replaces MySQL with binary. It was developed by some of MySQL’s original developers and many in the community. With the release of CentOS 7, MySQL was replaced by MariaDB as the default database system.

If for any reason you need to […]