1. Add a fieldCopy codeThe Code is as follows:If not exists (SELECT * from syscolumns where id = OBJECT_ID ('querydatasource ') and name = 'iscrosstable ')BEGINAlter table QueryDataSource ADD IsCrossTable bit default (0) -- insert FieldEND 2 stored
Recently, a very strange MySQL problem occurs. Using different select statements to query all datasets produces different records. Select * gets four records, and select field gets three records.For details, refer to the following query results:[SQL]
Recently, it has always been a headache to initialize data for the current project, and the auto-increment of database IDS is getting bigger and bigger, so we need to re-start auto-increment from 1: use the following method:Method 1: If no data is
We know that temporary tables have the following features:1. At the SESSION level, a SESSION is automatically dropped once it is disconnected.2. It depends on the default engine. If the default engine is INNODB, And you are crazy about using
Note: My runtime environment is widnows xp professional + MySQL5.01. Create a user:Command: create user 'username' @ 'host' identified by 'Password ';Description: username-the username you will create, host-specifies the host on which the user can
Create two user tables, user and user2. The table structure is the same, but the user table uses the InnoDB Storage engine, while the user2 table uses the MyISAM storage engine.Copy codeThe Code is as follows:-- Table "user" DDLCreate table 'user '('
A problem occurred while using order by today. I found that the previous understanding of ORDER BY is incorrect.I saw the order by usage on the w3s website and thought it was to sort the selected data in ascending or descending ORDER of the keywords.
The following excerpt describes utf8_unicode_ci and utf8_general_ci In the Mysql 5.1 Chinese manual:Currently, utf8_unicode_ci rules only support Unicode rules. Some characters are not supported. In addition, the combination of tags cannot be fully
A MySQL table can be considered as a queue, with each row being an element. Each query gets the first row that meets a condition, and deletes it from the table or changes its status so that it will not be obtained in the next query. Without
1.1 obtain the current date + time (date + time) function: now ()Mysql> select now ();+ --------------------- +| Now () |+ --------------------- +| 22:20:46 |+ --------------------- +In addition to the now () function, MySQL also has the following
Method 1. log on to mysql locally, change the "host" item in the "user" table in the "mysql" database, and change "localhost" to "%"# Mysql-u root-prootMysql> use mysql;Mysql> update user set host = '%' where user = 'root ';Mysql> select host, user
One master and one slave:Master:OS: centos release 5.6 DB: mysql 5.5.8 IP: 192.168.1.2Slave:OS: centos release 5.6 DB: mysql 5.5.8 IP: 192.168.1.3Modify the host Master configuration file (/etc/my. cnf)Copy codeThe Code is as follows:[Mysqld]// At
1. Add default-character-set = gb2312 to the [client] In my. ini under the mysql installation directory.[Client]Default-character-set = gb2312Port = 33062. Copy my. ini to the c root directory and change the name to my. cnf.3. When configuring the
Mysqlhotcopy is a MySQL Hot Standby tool. For more information, see the manual. For security reasons, we will assign users to Hot Standby:Grant select, reload, lock tables on *. * to 'hotcopy' @ 'localhost' identified by '123 ';If we only want to
In this case, you need to modify the user permissions in MySQL and grant the required permissions.
This article demonstrates this situation and provides detailed solutions.
The configuration in this example is as follows:
Discuz!Database Name:
MySQL databaseManagement is a crucial part for the database. To understand the management of the MySQL database, you must start from the basics. Only the commands used in database management are first known, the actual operation is much easier.
After installing mysql, the preparation file should be in the/usr/local/mysql/share/mysql directory. There are several preparation files, including my-huge. cnf my-medium.cnf my-large.cnf my-small.cnf, different traffic of the site and different
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 connection to MySQL cannot be established through port 3306.If you
Compared with the replication of NoSQL databases such as MongoDB and Redis, MySQL replication is quite complex!OverviewFirst, the master server records data changes to the master log, then reads the master log on the master server from the server
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