The following error occurred while executing a simple DESC statement:
mysql> desc ZAGCNY;Error 1030 (HY000): Got error from storage engine
The literal meaning is: get error%d from the storage engine
By searching, the approximate reason for this
INSERT INTO SELECT syntax
Statement form: Insert into Table2 (field1,field2,...) Select Value1,value2,... from Table1
Example
The code is as follows
Copy Code
Insert into User1 (name,address,phone) select
There is a small problem with Chinese characters when using length () in the database to fetch data lengths.
Check to see a webmaster is so understanding the length function
A sentence description: Get string length MySQL built-in function
Length
Found a solution from the Internet, here to record:
1. Admin login system, stop MySQL service or end mysqld-nt process;2. Go to the command line and come to MySQL's installation directory. Suppose the installation directory is d:/mysql/, cmd enter
Depending on the profile, MySQL restricts the packet size that the server accepts.
Sometimes large inserts and updates are limited by the Max_allowed_packet parameter, causing the write or update to fail.
View current configuration
Today I will copy the database data to Linux run the program "MySQL in the table is read only" The problem, the query information.
Linux execute the following command
#mysqladmin-U root-p flush-tables
And there's the directory permissions problem.
Case one: Shell+cron realize MySQL automatic backup and automatically delete n days before backup
The code is as follows
Copy Code
#!/bin/shDump=/usr/local/mysql/bin/mysqldumpout_dir=/home/ldl/xxx/backup/Linux_user=ldlDb_
Error prompts such as:
The code is as follows
Copy Code
$mysql-urootERROR 1040 (00000): Too Many connections
Because I use the MYSQL5 server is Win2000 This method is good to solve, find me MySQL installation
Today, using MySQL Workbench to connect to MySQL on VMware, has been unable to connect, after consulting the relevant information on the Internet, collected a number of solutions:1, Authorization law: MySQL root user by default only in the local
As the saying goes, the river can not get wet shoes, MySQL used more will also appear a lot of inexplicable problemsCan ' t open file: ' xxx. Myi ' (errno:145), this error is generally your database table file damage caused by the cause is probably
Add the "binary" property to the field containing Chinese as a binary comparison, such as changing "name char (10)" to "name char" binary.If you use the source code to compile MySQL, you can compile MySQL using the--WITH--CHARSET=GBK parameter, so
Backing up a database
The code is as follows
Copy Code
#mysqldump database name > Database backup Name#mysqldump-A-u user name-p password database name > database backup Name#mysqldump-D-A--add-drop-table-uroot-p
Unknown command ' "'
So the ' replace all ' result or not, the import is not.
However, it is possible to copy the database files directly to the past. Copy the past after the dump came out. The result is still the same effect
Unknown command ' "'
Calculate the number of yearsIf you want to calculate the age of the person by birth, you can use the following statement:
SELECT Date_format (From_days to_days (now ())-To_days (@dateofbirth)), '%Y ') + 0;
2. Two difference in timeGets the
The varchar type of MySQL database tutorial has a maximum length limit of 255 in the version below 5.0.3, and its data range can be 0~255.
In the MySQL5.0.3 and above versions, the length of the varchar data type is supported to 65535, which means
Modify the MySQL tutorial's engine engine
Modify My.ini, add under [mysqld]
Default-storage-engine=innodb
Where the red font part is the name of the engine to be specified.
To modify an engine that has completed a table with SQL statements:
MySQL Tutorial database Tutorial Automatic backup Restore method
Automatic Backup: Save the following code as a *.bat batch script, and then add Windows timed jobs, such as 2 o'clock in the morning daily:Set s=%date:~0,4%%date:~5,2%%date:~8,2%%time:
This article uses Ubuntu as an example to explain how to install the LAMP architecture of Linux, Apache, Mysql, and PHP in Linux. It can be used in Ubuntu and CentOS series.1. To install Apache, Mysql, and PHP, you must create an administrator
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