For an auto_increment?
1) What is its constraint capability? Is it as strong as not null? When a field is auto_inrement and an ID is provided to it, should the database layer not report an error?
The basic syntax of the create table
Respect for personal work. If the record is reprinted, indicate the source. Iihero @ csdn
Some of my friends asked me what is the difference between this non-installed version and the installed version (of course, it is a Windows platform)
When I used MySQL today, I accidentally killed the root user, and then I was unable to log on to the database. Baidu found the root user.Solution:
Stop MySQL #/etc/init. d/mysqld stop safe mode to enter MySQL #/usr/sbin // mysqld_safe --
1) connect to MySQL:
Format: mysql-H host address-u user name-P User Password
1. Example 1: connect to MySQL on the local machine
Mysql-uroot-P. Press enter and you will be prompted to lose the password,
If you have just installed MySQL,
Encountered sqlexception: Access denied for @ 'localhost' (using password: No)
Solution: grant all privileges on *. * to Joe @ localhost identified by '1 ';
Flush privileges;
Log in with Joe 1
Appendix:
Mysql> grant permission 1,
Last_insert_id () automatically returns the value of the first table set in the auto_increment column in The Last insert or update query.
Notes for last_insert_id of MySQL:
FirstThe connection object used for query and insertion must be the same.
String driver = "com. MySQL. JDBC. Driver ";
// The URL points to the name of the database to be accessed, scutcs
String url = "JDBC: mysql: // 127.0.0.1: 3306/scutcs ";
// Username for MySQL Configuration
String user = "root ";
// Password used
Solution
After mysql_real_connect is used for connection
Char reconnectarg =1;
Mysql_options (mconn,Mysql_opt_reconnect, (char*) & Reconnectarg );
How to test
MySQL configuration file my. the configuration item wait_timeout = 1 (eight hours
Original link http://www.mysqlsupport.cn/change_innodb_page_size/
Author: Wu Bingxi Source: http://www.mysqlsupport.cn/contact information: wubingxi # gmail.com reprint please indicate/translator and source, and cannot be used for commercial
I. Basic Introduction1. to_days (date)Returns the number of days (the number of days from 0 years ):Mysql> select to_days (20110311 );+ ------------------- +| To_days (20110311) |+ ------------------- +| 1, 734572 |+ ------------------- +1 row in
1./etc/My. CNF Default Configuration
The configuration file is as follows:
[Mysqld]
Datadir =/var/lib/MySQL
Socket =/var/lib/MySQL. Sock
# DefaultTo using old password format for compatibility with MySQL 3.x
# Clients(Those using the mysqlclient10
Summary: MySQL searches for duplicate rows and retains a record of the duplicate data according to certain conditions:
In the first case, the condition for determining whether the record is retained is a primary key or a unique value
----
Link from: http://www.5ilinux.com/blog/archives/000091.html
1. First, create the corresponding user and user group
Groupadd-G 5500 ftpgroupAdduser-u 5500-S/bin/false-D/bin/null-c "ProFTPD user"-G ftpgroup ftpuser
2. operate databases
MySQL
In the mysql clientShow [full] processlistWe can see the status of all the current threads and threads, including the SQL statements in execution, but the displayed statements are incomplete, and many Idle threads may cause interference.
Here we
Prepare the software first:
Apache Official Website:Apache_2.0.55-win32-x86-no_ssl.msi,More versions are available here;
PHP Official Website:Php-5.0.5-Win32.zip,More images,Download more versions;
Official MYSQL:Mysql-4.1.14-win32.zip,More
// Used for fast MySQL Big Data Backup// Modify the SQL file name, Database Host Name, database user name, password, and database name to be imported according to the code comment before use.// Simultaneously export the database file and the text
// Primary key
alter table tabelname add new_field_id int(5) unsigned default 0 not null auto_increment ,add primary key (new_field_id);
// Add a new column
alter table t2 add d timestamp; alter table infos add ex tinyint not null default '
Paste the sample code. It is very suitable for beginners.1) C # access MySQL
Using system; using system. collections. generic; using system. text; using MySQL. data. mysqlclient; using system. data; using system. data. common; namespace
This article explains how to completely optimize MySQL database performance in eight aspects.
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
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.