1. Change the passwordmysqladmin -u root -p password 123456 //修改密码为1234562. Go to MySQLmysql -u root -p3. Displaying the databaseshow databases4. Create a school databasecreate database school;5. Using the databaseuse 数据库名6. Create a tableCREATE
There are a lot of articles on the web to teach how to configure MySQL server, but considering the different server hardware configuration, the specific application of the difference, those articles can only be used as a preliminary setting
In MySQL, we can obtain information about how MySQL executes the SELECT statement through the EXPLAIN command, including the order in which the table joins and joins during the SELECT statement execution.Each column of the results of the EXPLAIN
http://my.oschina.net/zerotime/blog/113126MySQL command line when you create a stored procedure, you first enter a delimiterDELIMITER//CREATE PROCEDURE proc ()Begin......End//OK, you can create the completed.Show stored procedure commandsShow create
1.unix_timestampConverts a time into a timestamp. (date type data converted to timestamp form integer)Time stamp of the current time without passing the time parameterMysql> select Unix_timestamp ();+------------------+| Unix_timestamp () |+---------
The role of data types1: Reduce error rate2: Speed up the operationDefines the meaning of a numeric representation inside a characterLike whatThe ID int (10) indicates that the ID can store up to 10 digits, for example, 1234567890 of these values
A constraint is a restriction that ensures the integrity and uniqueness of a table's data by restricting the data on the table's Rows or columnsConstraint classification:Constraint types and keywords:
Primary KEY PRIMARY Key
Default
After a lapse of 1.5, the period has been wanted to write but feel no substantive content can be recorded, this article for [high-performance MySQL] Learning log collation Sharing (interested in the proposal to read the original book). Optimization
I. OverviewZabbix the MySQL plugin to monitor the MySQL database, but it is too primitive, for our DBA, the basic does not have any role, so need to do more detailed monitoring, and Percona has this detailed monitoring of the template and script,
This article installs MySQL under Linux, recording the most common MySQL statements in the workMySQL Add field and delete fieldTo add a field:To delete a field:ALTER TABLE ' user_movement_log ' drop column GatewayidTo adjust the order of
Ddl:databse Definition Language Creating a database create {db | SCHEMA} [IF not EXISTS] Db_name[Create_specification]Create_specification: [DEFAULT] CHARACTER SET [=] Charset_name [DEFAULT] COLLATE [=] Collation_nameexample1:View character set
To add a field: ALTER TABLE ' User_movement_log 'Add column Gatewayid int not null default 0 after ' RegionID ' (which field is added later) To delete a field: ALTER TABLE ' user_movement_log ' drop column Gatewayid To adjust the order of fields:
From the database to take n fields, and then combined together with the "," split display, at first thought with CONCAT () to deal with, good is the trouble, did not expect in the manual actually mentioned Concat_ws (), very useful.
Create a databasecreat table Test (#整数通常使用inttest_id int,#小数通常使用decimalTest_price Decimal,#普通文本通常使用, and use default to specify defaultsTest_name varchar (255) Default "Xxx",#大文本类型使用testTest_desc text,#图片使用blobTest_img Blob,#日期类型使用DateTimeTest_date
1, datetime,date,time,year Four types of values, can be entered manually, you can also call the function to get the value① manual input, in the following format:DateTime "2016-6-22 14:09:30"Date "2016-6-22"Time "14:09:30"Year "2016"As mentioned
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.