Fix it: My actual operation under Windows is as follows1. Close the running MySQL.2. Open the DOS window and go to the Mysql\bin directory.3. Enter mysqld-nt--skip-grant-tables carriage return. If you don't get a hint, that's it. 4. Open a DOS
*innodb_buffer_pool_size
If you use InnoDB, then this is an important variable. Compared to MyISAM, InnoDB is more sensitive to buffer size. Mysiam may also be fine with the default key_buffer_size for large amounts of data, but InnoDB feel like
1 installation. MySQL is installed in the/usr/local/mysql directory.
The code is as follows
Copy Code
Yum-y Install Perl PERL-DBIwget http://file.111cn.net/upload/2013/12/DBD-mysql-3.0002.tar.gzTar zxvf
Three table union queries we can use the following syntax
The code is as follows
Copy Code
SELECT * from a LEFT join B to a.id=b.id left join C on b.id=c.id
Example
Now it's time to list all the users and the
Remote access
Mysql-h localhost-uroot-p
Modify password
Mysqladmin-uroot-proot Password Admin
If the original password is empty
Mysqladmin-uroot Password Admin
Display version number, status, process information, etc.
Mysqladmin Version
The actual line of the scene is more complex, then involved in the TRUNCATE, delete two operations, confirmed lost data almost 70,000 lines, and so on stop, almost a total of more than 10,000 rows of data written. Here for a simple explanation, just
To see if the log is open
1. Can be confirmed by MySQL profile my.cnf (MySQL defaults to open binary logging):# Replication Master Server (default)# Binary logging is required for replicationLog-bin=mysql-bin
Refresh Log
Flush logs;
View current
Method One, delete all binary logs:
When the Reset Master command is executed on MySQL, all mysql-bin.* logs are cleared and the log file name begins at mysql-bin.000001
Reset Master
To delete a portion of a log:
The code is as
When there is too much SQL paging (for example, limit 1000000, 20), the efficiency is significantly reduced, how to optimize?
SQL Server uses a similar:
The code is as follows
Copy Code
SELECT Top * from USER order by
ALTER TABLE table_name AUTO_INCREMENT=N;Note that n can only be greater than an integer value of an existing auto_increment, and less than the value is invalid.Show table status like ' table_name ' can see auto_increment this column is a performance
To perform show slave status from the server, you can view a number of synchronization parameters, and we need to pay special attention to the following parameters:Name of the primary server binary log file that the I/O thread in
Two tables must be InnoDB table, MyISAM table temporarily does not support foreign keysThe foreign key column must be indexed, and the MySQL 4.1.2 version will automatically create the index when the foreign key is established, but if it is required
MySQL string functionASCII value of ASCII (char) return characterBit_length (str) returns the bit length of the stringCONCAT (S1,S2...,SN) connects S1,s2...,sn to a stringConcat_ws (SEP,S1,S2...,SN) connects the S1,S2...,SN to a string and uses the
The Binlog log is used to record all statements that have updated the data or have potentially updated the data. Statement is saved as an "event," which describes the data changes. When we cause the database to fail for some reason, we can use the
Test example, I login to my local MySQL database in phpMyAdmin, the default username password is root,root but I try to enter root, the password is www.111cn.net the following error reminder.
The following illustration shows a reminder that #1045
The syntax for explain is as follows:
Explain [extended] select ... from ... where ...
If you use extended, you can use the show warnings statement to query the appropriate optimization information after you finish executing the explain statement.
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 quick Database Tutorial Backup and automatic backup Bat processing method, the following is the bat batch method, followed by the common SQL data various backup commands.
@echo offEcho.echo MySQL Database backup
Echo ****************
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:
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