The code is as follows
Copy Code
Class cls_mysql{var $querynum = 0;var $link;var $histories; var $dbhost;var $dbuser;var $dbpw;var $dbcharset;var $pconnect;var $tablepre;var $time; var $goneaway = 5; Function Connect ($dbhost,
The mysqld_safe that uses the binary compilation file starts the error as follows:
[MYSQL@ECP-UC-DB1 ~]$ Mysqld_safe110707 21:31:19 mysqld_safe Logging to '/opt/mysql/mysqldata/ecp-uc-db1.err '.110707 21:31:19 Mysqld_safe the
1, install the configuration MySQL: This article installs the system is Centos6.3:
The code is as follows
Copy Code
Yum List MySQL # see if there are any packages installedYum install MySQL # install MySQL clientYum List
Station editing sometimes need to update some of the content to modify, if just a few data, we simply need to go directly to the Web site or MySQL data table can be modified, but if you need to modify a large number of the same string, the need for
Sub-table
1, do MySQL cluster, for example: Use MySQL cluster, MySQL proxy,mysql Replication,drdb and so onSome people will ask MySQL cluster, what is the relationship between the root table? Although it is not in the actual sense of the table, but
The format () function is used to format a number of x:###,###,##### truncated to D decimal places in the following format. The following example shows how to use and output the format () function:
The code is as follows
Copy Code
MySQL is an open source relational database system. Replication (Replication) is a process that replicates data from a MySQL database server (master server master) to another server (slave from the server).
Configure Primary server (Master)1, edit
Linux system boot MySQL log
The following configuration is placed under [mysqld]
The code is as follows
Copy Code
#查询日志Log=/var/log/mysql_query.log#慢查询日志Long_query_time = n the upper limit for execution of slow queries (
Workaround:
The first step: to restore the database and tables are UTF8 format (recommended UTF8, of course GBK or gb2312 also line)
The code is as follows:CREATE DATABASE ' Shegongku ' DEFAULT CHARACTER SET UTF8CREATE TABLE ' Members ' (' UID '
1, through floor error
You can use the following code
The code is as follows
Copy Code
and select 1 from (SELECT COUNT (*), concat (version (), Floor (rand (0) *2)) x to Information_schema.tables Group by X);and (select
Scene: Need to do a fuzzy query about the title, only a little more records, and need to be relatively accurate, such as search: AC, can not appear ABC, acceptable ACB,BAC, and so on.
MySQL Full-text search has three different modes:
One, natural
First look at the example
The code is as follows
Copy Code
SELECT P.price, Pd.name, m.manufacturers_name from (Products pLeft JOIN products_description pd on p.products_id = pd.products_id)Left JOIN manufacturers m on
Method one, directly package MySQL database under the data directory in the database you want to back up the name of the directory, and then restore can be directly replaced
Method Two, using Xcopy timed backup, the following code
Save the. bat
1. View MySQL database server and database character set
Show variables like '%char% ';
2. View the character set supported by the currently installed MySQL.
Show CharSet;
3, set the code:
Modify MY.CNFVi/etc/my.cnfAdd under
Statement
The code is as follows
Copy Code
Show grants for your users
Like what:
The code is as follows
Copy Code
Show grants for root@ ' localhost ';
View user rights.
Method one, with Mysqladmin
Here you use the two commands that come with MySQL Mysqladmin.exe and mysql.exe,mysqladmin the command format to modify the password is as follows
The code is as follows
Copy Code
1005: Failed to create table1006: Failed to create database1007: Database already exists, failed to create database1008: Database does not exist, delete database failed1009: Unable to delete database file causes database failure to be deleted1010:
Just install Python MySQL support library, a breath encountered a series of problems, fortunately, Google, are resolved. And the record, the memo.
1. Download Python's MySQL support library
Address: http://sourceforge.net/projects/mysql-python/
2.
Instance
The code is as follows
Copy Code
#locate Myisamchk#ln-S/usr/local/mysql/bin/myisamchk/usr/bin/myisamchk#myisamchk TableName. Myi#myisamchk-R-Q tablename
If-R does not use the enforcement command as
Htmlspecialchars
Converts special characters into HTML format.
Syntax: string Htmlspecialchars (String string);
return value: string
function Type: data processing
Content
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