Results > Posts Filed Under > Mysql

clear MySQL binary log files in mysql replication

If your MySQL binary log files are a “Growing” problem… there are a few simple steps you can use to curtail their growth and save your disk space from these huge files.
They probably look like:
mysql-bin.000001
mysql-bin.000002
mysql-bin.000003
mysql-bin.000004
mysql-bin.000005

And around 1 gig in size each.
These files are generated when you have log-bin=mysql-bin or other log-bin= line in your /etc/my.cnf configuration file.
There are two ways to fix this problem:
The first is to stop the MySQL server from creating these binary files. The only reason you …

Change Password for a Single User in MySQL

How to Update or Change Password for a Single User in MySQL and Reload Privileges
MySQL stores usernames and passwords in the user table inside the MySQL database. You can directly update a password using the following method to update or change passwords:
1) Login to the MySQL server, type the following command at the shell prompt:
$ mysql -u root -p
2) Use the mysql database (type commands at the mysql> prompt):
mysql> use mysql;
3) Change password for a user:
mysql> update user set password=PASSWORD(“newpass”) …

Mysql Clustering explained

Introduction to Database Clustering
In a classic MySQL database, rows of data are arranged in columns to form tables. These tables are stored in files on the disk of the database server, and queries are made to them. If the server crashes, the database goes down. If the load from all the queries gets too large, the only solution is to make the server more powerful.
Clustering spreads processing over multiple servers, resulting in a single redundant (that is, not reliant on …

how to change Mysql default data directory

By default, MySQL’s datadir is placed in the /var/lib/mysql directory.
Create the directory that will be new datadir (ex:-/home/db)
chown the directory to the mysql:mysql user
sudo chown -R mysql:mysql /home/db/*
You need to stop the mysql server using the following command
sudo /etc/init.d/mysql stop
Now you need to edit the /etc/mysql/my.cnf file
sudo vi /etc/mysql/my.cnf
and look for “datadir = /var/lib/mysql” this si where mysql database default data directory here you need to change this one to your new directory
datadir = /home/db
copy the files from the old …

 Page 1 of 2  1  2 »