PHP saves data to MySQL
We plan to clean up data before warehouse receiving at the DaO layer, such as varchar trim and INT for intval.
One day, I suddenly remembered that the value range of PHP intval is the same as that of MySQL's int type?
I
Eight methods to optimize MySQL Performance
1. select the most suitable field attribute
MySQL can support access to large data volumes, but generally, the smaller the table in the database, the faster the query will be executed on it. Therefore,
When MySQL is started, add the -- log-Slow-queries parameter to record the SQL statements whose execution time exceeds long_query_time seconds.
MySQL slowThe log analysis tool mysqldumpslow.Slow log is MYSQL based on SQLThe execution time of the
Based on the above MySQL
Cluster To achieve complete MySQL database backup and read/write at the same time. Now we want to achieve high availability, through an IP address can access the MySQL of each node at the same time. Achieve real high
To prevent security risks, we generally set an independent database access account for each database. This account has only the permission to access the database. Here is a detailed demonstration:
1. First, we need to log on to PhP (as the
The MySQL DATA table is broken. The following exceptions are mentioned when applications connect to the database:
1 java. SQL. sqlexception: Can't open file: 'kq _ atttemp. myi'. (errno: 145)
2 at com. MySQL. JDBC. mysqlio. checkerrorpacket
Enable MySQL slow query in WindowsIn Windows, the configuration file of MySQL is usually my. ini. Find [mysqld] and addLog-Slow-queries = F: \ mysql \ log \ mysqlslowquery. LogLong_query_time = 2
Enable MySQL slow query in Linux
The configuration
This article introduces the index data page storage structure of InnoDB, mainly introduces the overall structure of the data page, and the detailed structure of the page will be described in another article.
1. B + tree
Before reading this article,
MySQL Data Type introduction 0 rating/679 posted on:
1. MySQLData Type
Mysql has the following data types:
Numeric type
A value is a value such as 32 or 153.4. Mysql supports scientific notation, which is expressed by an integer or floating
A friend was in a hurry: mysql forgot the root password and asked me to help you. I found the information from the Internet because I have never been in touch with mysql.
I have already put it into practice! The mysql version is 5.1.
The following
If you want to connect to your mysql instance, this error occurs:
Copy codeThe Code is as follows: ERROR 1130: Host '192. 168.1.3 'is not allowed to connect to this MySQL server
Solution:
1. Change the table. It may be that your account is not
MySQL Connector/ODBC 2.50 (MyODBC 2.50) Connection ModeLocal Database ConnectionThe syntax format is as follows:Driver = {mySQL}; Server = localhost; Option = 16834; Database = myDataBase;The following syntax format is used for remote data
Simply put, you can use count and more fields in the query.Copy codeThe Code is as follows:Select count (id), id, name from tableIt's embarrassing. My environment is 5.5, and the results can be obtained, but it won't work if I run it on the
Relational databases depend on primary keys, which are the foundation of the Physical Mode of databases. The primary key has only two purposes on the physical layer:Uniquely identifies a row.As an object that can be effectively referenced by a
The following is an example of high CPU usage by MYSQL. I hope I will be inspired by my friends who have encountered similar problems. In general, MYQL occupies a high CPU usage, most of which is caused by database query code problems. Too many
There are three solutions to this problem:1. Increase the value of the wait_timeout attribute of MySQL.Modify the/etc/mysql/my. cnf file and set it in [mysqld:# Set a connection to wait 8 hours in idle status.Wait_timeout = 86400Related Parameters,
System: Ubuntu 10.10Mysql source file: mysql-5.5.8.tar.gzInstall required tools: cmake, GNU make, gcc, Perl, libncurses5-dev, bison (optional), chkconfigNote:1. There are several bugs in the official source code from, which were manually modified by
The following articles mainly introduce the five configuration parameters that closely affect MySQL performance. I saw the five configuration parameters that closely affect MySQL performance on the relevant website a few days ago, I think it's good.
1. Mysql databases do not have an incremental backup mechanism. When the data volume is too large, backup is a big problem. Fortunately, the mysql database provides a master-slave backup mechanism, which is to write all the data of the master
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