Rupeng net Study Notes (5) MySql basics and Study Notes mysql
MySQL Basics
I. Database concepts1. The equipment information, forum post information, QQ friend relationship information, and student information in the student status management system must be stored permanently in one place,If I/O is used to write data to
Usage of mysqlloaddatainfile (importing 40 W data to mysql in 3-5 seconds) bitsCN.com
If you want to import Chinese data, the utf8 character set in mysql will save the UTF-8 character set for the xxx.txt file you want to import. the command load data infile "d: /Websites/Sxxxx/test1.txt "ignore into table 'names' fields terminated by ', 'enabledby '"';
I don't kn
Mysql Query statement (mysql study note 7) bitsCN.com
SQLStatement
General sequence GHOL:Group by, having, order by, limit
For grouping, sort the grouping fields.GroupSyntax
Limit start, length
Remove duplicate recordsDefault value:All
Select distinctFieldFrom
Select distinct * fromUseless (The combination of all fields is not the same.), Take one of the record v
MySQL study Note 7: Basic query bitsCN.com
Reference Table: student
Multi-field query
mysql> select id,name,birth from student;
Query all fields
mysql> select * from student;
Where specified query
Mysql> select * from student where id = 901;
format (rand (), 2 );Select floor (rand () * 5) + 1; [1-5] random valueSelect length (trim ('Jack '));Select strcmp ('A', 'w ');
Summary:
1. link integrity(1) entity (row) integrity: each record has a unique identifier, which is usually expressed by a field without any business meaning.
(2) integrity of reference: A field in one (A) table must reference A field value in another (B) table, and the field in
Install MySQL in CentOS 7 and mysql in centos
Since MySQL was acquired by Oracle, the default yum database of CentOS was changed from MySQL to MariaDB.
To install MySQL, we need to add the official
A view is a virtual table exported from one or more tables. A view is like a window in which you can view the data provided by the system. This article introduces the MySQL Getting Started Tutorial (7). For more information, see
Related reading:
MySQL Getting Started Tutorial (5) create, modify, and delete tables
A vi
MySQL is/usr/local/mysqlmkdir-p/usr/local/mysql.
5. decompress the MySQL source package
tar -zxvf mysql-5.7.16.tar.gz
6. Create mysql users and user groups
# Create a user group groupadd mysq
tid from teacher where tname like ' li% ') as B 6, inquiry did not learn the "cotyledons" teacher class students of the school number, name; Train of thought: First find "Li ping" teacher taught all the lessons ID received All student IDs selected for the class are filtered in the student table select * FROM student where SID is not in (select DISTINCT student_id from score where s core.course_id in (select CID from course left JOIN teacher on course.teacher_id = teacher.tid where tname = ' Li
not exist then read the Basedir directory my.cnf, if the system environment variable does not basedir, Attempt to read the MY.CNF in the current directory where the service was started, this is/opt/mysql/my.cnf this case, or if it does not exist, read the. mysql/my.cnf in the current user's home directory. (see the official document for confirmation, not to be remembered). So, we just need to make sure tha
Install MySQL 5.7.11 for Linux Generic binary in CentOS 7 using the command line
The latest version of MySQL is 5.7.11. in Linux, the installation package of a specific release version is provided (for example, .rpmloud and a general version installation package (.tar.gz ). In general, many projects tend to use the binary universal installation package for instal
MySQL study Note 5: modifying the table (altertable) bitsCN.com we will inevitably consider the week before creating the table. Therefore, the alter table statement is required to modify the table later.
Modify table name
Mysql> alter table student rename person;
Query OK, 0 rows affected (0.03 sec)
Student is the original name and person is the modified na
I installed Windows 7 in the past two days. Some time ago, a friend asked me how to install and build the PHP environment in Windows. So I plan to work hard to build the PHP environment step by step, currently, you do not need to use the PHP environment to build software. Here is a detailed tutorial on installing and configuring the PHP + Apache + Mysql environment in Windows
MySQL study Note 5: modify the table bitsCN.com
When creating a table, we will inevitably consider the problem of weeks. Therefore, the table will be modified later.
The alter table statement is required to modify a table.
Modify table name
mysql> alter table student rename person;Query OK, 0 rows affected (0.03 sec)
Student is the original name and person is th
MySQL Study Notes 7-data backup and restoration bitsCN.com
Back up a database using the mysqldump command
Basic syntax: mysqldump-u username-p dbname table1 table2...> BackupName. SQL back up multiple databases
Syntax: mysqldump-u username-p -- databases dbname1 dbname2> bankupName. SQL back up all databases
Mysqldump-u username-p -- all-databases> BackupName. SQL directly copies the entire database Dir
all rows, locking is not required. locking also reduces the overall connection time. however, the maximum waiting time for some threads will rise. for example:
Thread 1 does 1000 inserts
Thread 2, 3 and 4 does 1 insert
Thread 5 does 1000 inserts
If no lock is used, 2, 3, 4 will be completed before 1 and 5. if locked, 2, 3, 4, it may be completed after 1 and 5. h
How to Install MySQL on CentOS 7Updated Thursday, August 27th, by LinodeUse promo codeDOCS10For $ credit to a new account. Contribute on GitHub View Project |View File | Edit FileMySQL is a popular database management system used for Web and server applications. However, MySQL is no longer in CentOS's repositories and MariaDB has become the default database system offered. MariaDB is considered a drop-in re
Mysql query today, yesterday, last 7 days, last 30 days, this month, last month data, mysql January
Recently, the data record query function for the current month was used in the project. The original idea was to construct a period of time in the logical business for query. It was quite troublesome to write SQL statements. So I searched the internet to see if the
MySQL from the command line, and then run the create database mydb2 command to CREATE the DATABASE mydb2.2. to exit MySQL, enter the command exit or quit;3. enter the following command in CMD: C:/> MySQL-h localhost-u root-p mydb2 Then enter the password, and then OK.5. Next, let's talk about how to solve the import f
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.