not running! "| Mail-s" ERROR! $ MYSQLIP MySQL Slave is not running "start@gmail.com-c user1@gmail.com-c user2@gmail.com-c user3@gmail.com
Fi
Recently, due to actual needs, the following changes have been made to the script and DNS monitoring has been added. The difference from the previous one is that an email is sent. Instead of sending an email when there is an error.
#!/bin/bash-x
#checkMySQ
MySQL architecture is master-slave), master failure is automatically switched to slave. You can also set it to a dual master, but there is a drawback: when the pressure on the master is very high, the latency from the top is very large, such as 2000 seconds behind, the master is down now, from taking over the VIP to the slave), the user just published an article, because the synchronization latency is large and has not been copied yet, so the user pub
First, start the MySQL service1, the way oneA, Win+r: Open the Run windowb, input services.msc Open the Service settings interfaceC. Find MySQL service, start or deactivate2, the way two did not test passA, Win+r: Open the Run windowB. Switch directory: cd C:\Program files\mysql\mysql Server 5.5\binC, execute command:
This script can be done without human intervention to complete the L.A.M.P integration work.
This script applies to the apache2.0.5x,php4.0.x and compiled (binary version) mysql4.0.2x of the consolidated source package approach.
Note that the above three packages are best downloaded from their respective official sites, and it is best not to change the filename after downloading!
How to use:
=====
1, wil
Programs on the Linux server update the MySQL database every day, so remember to write a shell script, combined with crontab, to back up the database regularly. Actually very simple, the main is to use the mysqldump command with MySQL.
#!/bin/bash # Shell script to backup MY
This article describes how to read and write a MySQL database in a shell. This paper mainly introduces how to connect the MySQL database in the shell, how to create the database in the shell, create the table, insert the CSV file, read the MySQL database, export the MySQL database as XML or HTML file, and analyze the c
Tags: folder create Linux MySQL softwareAfter studying the two-week Linux shell script, I finally wrote out a MySQL automation installation script. Plus today's full-day test, you can perform the installation of MySQL 5.5.40 normally. Other versions have not yet been tested.
I wrote a MySQL backup script in Linux. This is the first version. Only one database can be backed up. Every night at, I run the script with a timer and it will be automatically backed up. Coming soon
I wrote a MySQL backup script in Linux. This is the first version. Only on
Mysqld_safe start script source code reading and analysis I read the mysqld_safe script a few days ago. I personally think it is quite rewarding. I carefully explained the MySQL database startup process, including searching MySQL-related directories, parsing the configuration file and finally calling the mysqld program
Tags: configuring for password-free loop mail Client Add database1. Configure MySQL local password-free loginAccount password information will be recorded in the user's home directory ". mylogin.cnf" file, if you want to re-enter the password to log in, then delete this file.2. Configure mail forwardingWe need to install the mail client software "MAILX" and then configure the corporate public mailbox for mail delivery.3. Writing scriptsWriting ideas:
Generally, it is not recommended to upgrade the database version. This script is dedicated to version control. To prevent compatibility issues between major versions, scripts by default only support upgrades between the same major version, such as MySQL-5.6.25 upgrade to MySQL-5.6.26, MySQL-5.5.44 upgrade to
The MySQL5.6 script is compiled and installed in the source code package. Two MySQL databases are installed on one machine. The port, installation path, and socket file location are specified during compilation.
The installed MySQL installation file can be packaged and copied to other machines for use. You only need to initialize it when using other machines, and
Ubuntu MySQL Automation installation script
Copy Code code as follows:
#/bin/bash
function hasdpkg
{
R= ' Dpkg-l | grep "$"
If [-N "$r"]
Then
H= ' Dpkg-l | grep "II" '
If [-N "$h"]
Then
Return 1
Else
return 0
Fi
Else
return 0
Fi
}
Mysql= "mysql-server-5.5"
Has
as follows:
*/10 * * * * root/bin/sh/root/mysql_slave.sh
Remember in each MySQL from the machine to allocate a Yuhongchun user, the permission is not OK, only limited to run locally, as follows:
Copy Code code as follows:
Grant all privileges on *.* to "Yuhongchun" @ "127.0.0.1" identified by "yuhongchun101";
Grant all privileges on *.* to "Yuhongchun" @ "localhost" identified by "yuhongchun101";
========================================================== ==========This article isHeyuanhuiOriginal
Make sure that the original author information and original links of this article are complete and retained!
NN: khlerE-mail:Khler@163.comQQ: 23381103MSN:Pragmac@hotmail.com========================================================== ==========
Recently, a service named TWS is implemented in Linux. It outputs logs using Syslog and uses MySQL as the bac
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.