How to use a Python script to query the value of a remote database and insert that value into column B as a whole in the CSV "column A" relationship, recently handle a case, Associating python with the obvious advantage of data processing over the
Multi-Environment Toss Python-mysqlRecently in the toss write a test case scheduling execution of the script, and MySQL will have some interaction. Developing tests under a Mac is OK, but porting to the server has found too many problems.Installed
The exact contents of the error are:
121012 11:35:03 [note] Plugin ' federated ' is disabled.121012 11:35:03 InnoDB:Error:unable to create temporary file; Errno:2121012 11:35:03 [ERROR] Plugin ' InnoDB ' init function returned ERROR.121012 11:35:03
Previously written about how to deal with the MySQL Chinese garbled problem, the results found that it is necessary to write this article.
The reason is that many times, in order to secure, do not allow MySQL management tools to connect the formal
The syntax is as follows
The code is as follows
Copy Code
Grant all privileges in ' db_name '. * to ' user_name ' @ ' HOST ' with GRANT OPTION;
Cases
Grant normal data user, the right to query, insert, UPDATE,
MySQL's Self connection processing speed is much faster than subquery. So it is necessary to learn from the connection.
Normal SQL subquery statement
The code is as follows
Copy Code
Select ' id ', ' bic ' from ' Biao '
Today I found an interesting problem in sorting the country phone number list, and I wanted to sort the isdcode fields in order from small to large, so I wrote them.
The code is as follows
Copy Code
SELECT * from
Days in doing OpenCart development, the user's table needs to connect the phone number and area code, and then use the Concat method,
The code is as follows
Copy Code
SELECT CONCAT (isdcode,telephone) from Gb_customer
The MySQL service failed to start properly because it was not properly shut down. After reinstalling then still cannot enter the root account hint 1045 error.
Workaround:
1. Stop Service
2, modify My.ini, find "mysqld", add a line under it
Cases
The code is as follows
Copy Code
Example: There are importdata.sql files, the contents of which are as followsSET sql_mode= "No_auto_value_on_zero";CREATE TABLE ' BBS ' (' id ' int (one) not NULL auto_increment,'
On a station today, open the first page is all garbled, in the browser up a few times encoded characters, are wrong, asked the next PHP development to know that the original SQL file used in the UTF8 code, and my MySQL does not specifically specify
The following Linux shell script is used to automatically back up the MySQL database on a daily basis, which can be performed on a daily basis via Linux crontab. In the script you can set up a list of database tables that need to be backed up, and
The usual way to set up a self-add field:
Add when creating a table:
CREATE TABLE table1 (ID int auto_increment PRIMARY key,...)
Add after creating a table:
ALTER TABLE table1 Add ID int auto_increment primary key self-add field, be sure to set
• View the size of each library
The code is as follows
Copy Code
SELECT SUM (data_length) +sum (index_length) from information_schema.tables WHERE table_schema= ' database_name ';
The result is in bytes, except
First, mysqladmin-u user name-p old password password new password
1, to root add a password ab12. First in DOS into the directory MySQL bin, and then type the following command
Mysqladmin-u Root-password AB12
Note: Since Root does not have a
MySQL database table automatic backup shell script
Call Example:
The code is as follows
Copy Code
Mysql_data_backup.bash Www_casMysql_data_backup.bash 112 Www_qicheMysql_data_backup.bash 112 Www_health
Include
Query number of duplicate data
The code is as follows
Copy Code
Select device_id from Device group by device_id having count (device_id) > 1;
Query all duplicate data
The code is as follows
System CentOS 6.3 Mini (without any compilation environment)
The precompiled environment first installed the well-known cmake (yum install cmake-y)
The code is as follows
Copy Code
1./bootstrap Error when bootstrapping
This article uses the built-in change function inside my software, can forcibly modify the MySQL database password with one click,During the modification process, the MySQL main program will be forced to kill, the modification is completed after the
1. Preparatory work:To prepare a master server, my IP address is 192.168.13.138, and a Slave server: 192.168.13.137, database version consistent, master and slave libraries are built corresponding libraries and tables;2, modify the master-slave
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