1. MySQL Common commands Create Database Name; Create a database
Use databasename; select database
Drop database name directly deletes the database, no reminder
Show tables; displays tables
Describe tablename; Detailed description of the table
Add
An error occurred while trying to connect MySQL with phpMyAdmin after Wamp is installed. The error is as follows:
PhpMyAdmin tries to connect to the MySQL server, but the server rejects the connection. Check the host, user name, and password in
1. Password modification: Use the mysqladmin command
1. For example, if your root user does not have a password and you want to change the password to ABC, the command is mysqladmin-u Root Password ABC.
2. If your root account has a password, the
First create a table
Use test;
Create Table tabletest (
'Id' mediumint (8) default '0 ',
'Name' varchar (100) default''
) Type = MyISAM;
Import data to a data tableLoad data infile 'C:/data.txt 'into Table 'tabletest'
Commonly used:Load
Related methods:
Service mysqld stop
Or
Killall-term mysqld
Next, run the following command to restart MYSQL:/Usr/bin/safe_mysqld -- skip-grant-tables &(Please pay attention to your itinerary. Please turn it into your program path)
Start
New or changed features:
Security Enhancement: Enable strictly controlled positions from which user-defined functions can be loaded. The plugin_dir system variable has
Backported from MySQL 5.1. If the value is not empty, the User-Defined Function
You probably browsed it for the following reasons:
One possibility is that the SQL statement sent is too long and exceeds the size of max_allowed_packet. For this reason, you only need to modify my. CNF and increase the value of max_allowed_packet.
1. Design Principles1) standardization and standardization
Data Standardization helps eliminate data redundancy in databases. There are several forms of standardization, but third Normal Form (3nf) is generally considered to have achieved the best
This article was first published on the infoq Chinese site.
Author: Dragon, fenng. Note: If you want to reprint it, please note this
Article First author!
This article is a summary of dragon's discussion. Sorting in dB is still applied
Program
CopyCode The Code is as follows:/* create a data table */
Create Table td_base_data (ID int (10) Not null auto_increment, userid int (10) default '0', primary key ('id') engine = MyISAM default charset = GBK;
Create Table td_base_data_20090527 (ID
Mysql> select something from tbl_name
Where to_days (now ()-to_days (date_col)
Dayofweek (date)Returns the week index of date (1 = Sunday, 2 = Monday,... 7 = Saturday ). The index value complies with ODBC standards.Mysql> select dayofweek ('2017-
1. Create a database and a Registry
CopyCode The Code is as follows: Create Database db_register;
Create Table db_register.tb_register (
Reg_loginid varchar (20) primary key,
Reg_name varchar (20) not null,
Reg_id int not null,
Reg_password
1. Install MySQL
Run MySQL InstallationProgramMysql-essential-5.1.40-win32.msi)
Select custom as the installation type.
Click the change button to change the installation directory.
Change the installation directory to D (depending on
MySQL random query data I have discussed this issue in the group before. It is quite interesting. mysqll syntax is really fun. they all wanted to use PHP to implement random queries, but retrieving multiple entries seemed to require more than two
After query, I know that the MySQL field is too long, so I just changed the length of the two fields.
When an index is created, the length of the key calculated by the database is to accumulate the char length of all the fields used by the index,
1. install php1) Create a New PHP folder on the D Drive and decompress php-5.2.0-win32.zip to D: \ PHP.
2) Find the PHP. ini-dist file in the D: \ php folder and copy it for backup. Rename the copied file to php-ini.
3) in the php. ini file, find
The table lists various numeric types, their permitted ranges, and occupied memory space.
Type
Size
Range (Signed)
Range (unsigned)
Purpose
TINYINT
1 byte
(-128,127)
(0,255)
Small integer
SMALLINT
Directory
1. Character Set Selection 1
2. Primary Key 1
3. Foreign key 2
4. index 2
4.1 The following conditions are suitable for creating an index 2
4.2. Index 3 is not suitable in the following cases
4.3. Joint index 3
4.4. Index length 4
5.
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