Perl's operations on MySQL.
First, the standard operation
1, Connect, close
My $dbh = Dbi->connect ("Dbi:mysql:database=dbname;host=localhost", "User", "pwd", {' RaiseError ' => 1});
... ...
$DBH->disconnect ();
2. No return operation such as
Today found MySQL's master-slave database is not synchronized
First on the Master library:
Mysql>show processlist; Check to see if the process is too much sleep. Found to be normal.
Show master status; is normal.
Mysql> Show master status;
+----
When are we going to use the copy table? For example: I now operate on a table, but I am afraid of accidentally delete data, so in the same database to build a table structure, table data is the same table for backup. If use mysqldump compare
MySQL has a function is log down to run the slower SQL statement, the default is not this log, in order to open this function, to modify the my.cnf or in the MySQL boot when the add some parameters. If you modify inside the MY.CNF, add the following
Today's class to sum up some of the blog tips, which is more sense of achievement is how to achieve "title-category name-blog name", hehe! Then there are students chasing me to ask me MySQL installation problem, thanks to no class, or stuck, looking
Today found MySQL's master-slave database is not synchronized
First on the Master library:
Mysql>show processlist; Check to see if the process is too much sleep. Found to be normal.
Show master status; is normal.
Mysql> Show master status;
+----
These days based on Heritrix wrote a crawler, used to MySQL, in the import of exported data, encountered some garbled problems, and finally solved, record, for viewing.
First, export the data.
First explain your environment: Mac OS X 10.8.3, MySQL
Workaround One:
MySQL installation when the code,
Look at the My.ini, there's no
[MySQL]
Default-character-set=utf8
[Client]Default-character-set=utf8
[Mysqld]Default-character-set=utf8 set up when creating a table:
DROP TABLE IF EXISTS '
To know the size of each database, the steps are as follows: 1, access to the INFORMATION_SCHEMA database (the information stored in other databases)use INFORMATION_SCHEMA;2, query the size of all data:Select concat (Round (sum (data_length/1024/1024
Some time ago purchased the Aliyun host. Because you need to use the Java environment instead of Php+apache this one-button installation of things, so did not download the Aliyun official online said Sh.zip. Besides, there is no gzip in this
Linux environment, after the installation of MySQL, you can not start the service directly, you must first initialize the database. The main tasks of initialization include:
Initialization of the log, table space and other databases must
We know that Oracle has dataguard real-time backup data, you can make the switch, and MySQL also has its own set of program, called Master-slave replication.
To build MySQL from the library is to synchronize the main library data in real time, and
See if the event is open
The code is as follows
Show variables like '%sche% ';
To open an event plan
The code is as follows
Set global Event_scheduler = 1;
Create stored Procedure test
The code is as follows
CREATE PROCEDURE Test ()
BEGIN
In the mysqld section of my.cnf, add bind-address=127.0.0.1. You can make MySQL listen to only a specific address.
Q: How can I specify that MySQL only listens to a specific address?
A: A more common approach is to add bind-address=127.0.0.1 to
Parsing: A method for establishing a foreign key in MySQL
Example:
1. Main Table
DROP TABLE IF EXISTS ' Biao ';
CREATE TABLE ' Biao ' (
ID ' int (one) not NULL auto_increment,
Title ' varchar (one) default NULL,
Content ' varchar (one)
This article mainly describes the way in which MySQL responds to a disk full error (such as "No remaining space on the device"), and how to respond to a quota error (such as write failure or "Reach User screen limit").
The content described in this
Into the MySQL bin directory of this machine, remember that it is the machine! Create a text document
mysqldump-h127.0.0.1-uroot-p123456 Diguang > Diguang.sql means to make the native Diguang database a diguang.sql script, and the
MySQL database default maximum connection data is 100, if we want to modify can take advantage of two ways, one is the set GLOBAL max_connections command execution, the other is to open the MySQL profile My.ini or my.cnf lookup max_ Connections=,
1. Introduction to the IndexAn index is a special database structure that you can use to quickly query specific records in your data.The indexes in MySQL include: normal index, uniqueness index, full-text index, single-column index, multicolumn
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service