Find the my. ini file in the mysql installation directory and add the following code:Interactive_timeout = 120Wait_timeout = 120Max_allowed_packet = 32 M==============================================Small ExampleThe mytest_emp_dept. SQL file
The MySQL command under Fedora is described in detail first. I am also just learning MySQL. If something is wrong, please correct me and hope that I can help you with some experience. The following describes my installation:1. My operating system is
Recently, it has always been a headache to initialize data for the current project, and the auto-increment of database IDS is getting bigger and bigger, so we need to re-start auto-increment from 1: use the following method:Method 1: If no data is
First stop the mysql service:Copy codeThe Code is as follows:Root @ webserver:/home/webmaster # service mysql stop Then, a new mysql service is created in the ignore Password Authentication Mode:Copy codeThe Code is as follows:Root @ webserver:/home/
Go to the installation directory.../bin/mysql.exeCd change Directory dir list all files in the current directoryC: \ vesa \... \ a> Angle brackets indicate that they are in the folder of disk c/vasa /.../.Cd space... indicates the directory to the
Friends who are used to other tools such as phpmyadmin do not have the command at all. If you have a written test to interview me and see what you do, it is very useful to study it, you can also know what the tool did when you used the GUI tool.
The following code is often used in php to obtain the SQL query statement for determining the date.Copy codeThe Code is as follows:$ Now = time (); // get the current date$ SQL = "select * from 'team' where end_time> $ now ORDER BY sort_order limit 0
Problem (Multiple Primary auto-growth IDs are repeated)1: First, we use the test table structure of A and B.2: Drop A, insert the data table test (with an auto-increment ID) on B, and return the insert ID as 1.3: Stop B and insert the data table
Because there is no way to add a read server in a short period of time, we have made some configuration for Mysql to sacrifice the real-time data, in exchange for the life security of all servers. The specific adjustments and ideas are as
To randomly extract a record FROM the tablename table, the general syntax is: SELECT * FROM tablename order by rand () LIMIT 1.However, I checked the MYSQL official manual. The prompt for RAND () indicates that the RAND () function cannot be used in
Modify my. ini and add
Default-storage-engine =INNODB
The red font indicates the engine name to be specified.
Use SQL statements to modify the engine of a table:
Alter table tableName type = InnoDB
My. ini file for reference
In MySQL database operations, we often write some SQL statements to implement the functions we want. However, it seems difficult for beginners of MySQL databases. This article summarizes six useful SQL statements. Beginners can use the following
I. Automatic Backup: Save the following code as a *. bat batch processing script, and then add Windows scheduled jobs, such as running at every day:Set s = % date :~ 0, 4% % date :~ 5, 2% % date :~ 8, 2% % time :~ 1, 1% % time :~ 3,2% % time :~ 6, 2%
ERRNO: 256TEXT: SQLSTATE [HY000]: General error: 1436 Thread stack overrun: 4904 bytes used of a 131072 byte stack, and 128000 bytes needed. use 'mysqld-O thread_stack = # 'to specify a bigger stack.
According to the MySQL manual "The default (192KB)
The following error occurs: "Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file', or the Master/Slave database is not synchronized due to data clearing. The
WINDOWS1. MySQL has some environment variables that can be set,You can enter show variables to view the current environment variable settings;2. Some of these variables have character-related settings,You can enter: show variables like 'character % '
I. Major changes from 4.0 to 4.1If an InnoDB table containing the TIMESTAMP field is created in MySQL from version 4.1.0 to version 4.1.3. You need to recreate the table when upgrading to 4.1.4 and later, because the storage format has
FirstCopy codeThe Code is as follows:# This File was made using the WinMySQLAdmin 1.4 Tool#2004-2-23 16:28:14# Uncomment or Add only the keys that you know how works.# Read the MySQL Manual for instructions[Mysqld]Basedir = D:/mysql# Bind-address = 2
MySQL databaseManagement is a crucial part for the database. To understand the management of the MySQL database, you must start from the basics. Only the commands used in database management are first known, the actual operation is much easier.
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