Create a database:
CREATE DATABASE stefan;
Delete database:
DROP DATABASE stefan;
Rename a database:
There is no direct way to rename the database.
Methods that are no longer used:
RENAME DATABASE stefan TO LCDB;
Create Table Syntax:
Create table
In MySQL, inserting a record is very simple, but in some special applications, before inserting a record, you need to check whether the record already exists. The insert operation is performed only when the record does not exist, this article
How can I set the installed phpmyadmin to automatic login!
(1) Find config in the root directory. inc. php (root directory) or config. default. php (root directory) And then: libraries \ config. default. php (Friendly reminder: Because different
When exporting data in a database, how do we export data from a table without exporting all the data in the table? The following example shows how to perform this operation.
Assume that a data table (news) has three fields: id, title, and content.
Occasionally, you need to use php to perform some mysql Database Operation tests. It is too troublesome to write by yourself. The search results generally contain a lot of useless code. Here we will summarize the operations of php mysql, I hope you
Number of statistical data rowsThe select count () FROM syntax is used to COUNT the number of rows in a data table.Syntax:Select count (column) FROM tb_nameThis SQL syntax is used to COUNT the number of rows in a certain field. COUNT () cannot
MySQL in Linux is case-sensitive by default. You can use the following settings to make MySQL case-insensitive:1. Log On with root and modify/etc/my. cnf;2. Add a row under the [mysqld] node: lower_case_table_names = 13. Restart MySQL;
The
By default, MySQL search is case-insensitive (however, some character sets are always case-sensitive, such as czech ). This means that if you use col_name LIKE 'a % 'for search, you will get all columns starting with a or. If you want to make the
PhpMyAdmin
PhpMyAdmin is a PHP-based MySQL database management tool based on the Web-Base architecture on the website host.
You can manage the entire MySQL Server (requires a Super User) or a single database. To implement the latter, You need to
The following is the core SQL code of the project based on the age group of men and women:
COUNT (tr. id) AS 'Total number of health checks', SUM (case when s. sex = 1 THEN 1 ELSE 0 END) AS 'total male check', SUM (case when s. sex = 0 THEN 1 ELSE 0
MySQL is a very popular small relational database management system. Currently, MySQL is widely used in small and medium websites on the Internet. Because of its small size, fast speed, and low total cost of ownership, especially the open source
In the past few days, I will share and summarize some SQL experience optimized in the past few days. The first thing to share is to optimize the limit page for MyISAM. Background: A business system provided by the company to crawlers to capture data.
There are two major steps to enable the MySQL remote login account:
1. Check whether the firewall on the server does not block port 3306.
The default port of MySQL is 3306. Make sure that the firewall does not block port 3306. Otherwise, the remote
Table Partitioning can be performed in two ways::
: Place data rows in two independent tables based on the values of one or more columns of data.Horizontal segmentation usually uses a large table in the following situations. After segmentation, the
Recently, the project database management system was migrated from SQL SERVER2000 to MySQL. After connecting to SQL SERVER Based on ADO and using the MySQL database management system, the database creation, table creation, and database read/write
1. Test 1Create table test (id int, tag int, num int );Insert into test (id, tag, num) values (1, 1, 1), (2, 2), (3, 3 );Update test setTag = 4, num = case when tag = 4 then 4 else 3 endWhere tag = 3;Select * from test;(1) sqlserver2014 results:(2)
Use show variables like 'character % 'to view the database encoding. latin1 is expected.
If the project is being tested and the data is not important, the solution is to use alert database tuanplus character set utf8 to change the encoding format
Command for viewing the mysql character set.
Including viewing the character set of the mysql database server, viewing the character set of the mysql database, the character set of the data table and field, and the character set supported by 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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service