Today, when importing a new database, there are 40 or so tables in it. Internet search a lot of information finally learned, but the network has a lot of information on the correctness of the actual operation to verify its authenticity!Here is the
Snail carrying a heavy shell, sticking to the ground step by step difficult to crawl forward, do not turn back, nor look around, just toward the place where they want to go.Sometimes you need to extract data from multiple tables of the same type,
Today using MyBatis query MySQL data, all the time is wrong, all the time than the database time more than 14 hours, considered a bit, the initial decision is the system time zone problem. Because the MySQL time zone setting defaults to the
Too long not to use SQL statements are some forget, today's work encountered that try to record itThe requirement is this: To query the same field, two other values that specify different contentThe main idea is to use where......inThe statement is
1. The first type:The key to relieve the master-slave table constraintIn general, when we add foreign keys to the main table, remember to design the foreign key name so that you can delete the foreign key constraint later.To declare the FOREIGN KEY
Permissions
Revoke permissionsRevoke all on * * from ' root ' @ ' 192.168.0.197 ';
Revoke permissionsRevoke all on * * from ' xx_db ' @ '% ';
Give the specified user permissions to the specified database selectGrant SELECT on
1, into the PHP source package installation path Pdo_mysql directory inside/usr/local/src/php/package/php-5.6.29/ext/pdo_mysql2. Run phpize, generate a configure file in this directory/usr/local/php/bin/phpize3. Run config to specify MySQL and PHP
Tag:data use Error could err 1.0 count meta city my sql connect_ errno) {die ("could does connect to the database:\n". $mysqli->connect_error);//Diagnostic connection Error} $mysqli->query ("Set names ' UTF8 '; "); /encoded
1.mysql and Promise-mysqlNodejs connection MySQL has a mature npm package MySQL, if required promise, recommended to use Promise-mysql;Npm:https://www.npmjs.com/package/mysqlHttps://www.npmjs.com/package/promised-mysqlIn the actual development, the
1. Create a data tablecreate table table_name( id int not null auto_increment, name char not null, age int not null, register_date date, primary key(id);)2. Inserting data (increment)insert into table_name (name,age,register_date)
MySQL is not like Oracle has plsqldevelper tools to debug stored procedures, so there are several simple ways to track the execution process: 1, with a temporary table, recording debugging process; 2, directly in the stored procedure, add select XXX,
auto_increment Questions:Https://yq.aliyun.com/articles/59263?spm=5176.8091938.0.0.bjzoFNHttps://dev.mysql.com/doc/refman/5.7/en/innodb-auto-increment-handling.htmlSeveral situations that cause auto_increment to become smaller:Reference:
MySQL clears the database operation: TRUNCATE TABLE tablename;The simple format that MySQL gives to user rights commands can be summarized as: Grant permissions on database objects to usersA grant general data user, the right to query, insert,
MySQL (default data table Myisam&inonodb)Can be set in MySQL config file My.ini, the book is written in Default-table-type. But not found in the My.ini, but# The default storage engine that would be used when create new tables
MySQL Master-slave replication
MySQL master-slave replication is an asynchronous replication process in which the main library sends update events to the library, reads the update records from the library, and executes the update records,
To modify the database character set:The code is as follows:ALTER DATABASE db_name DEFAULT CHARACTER SET character_name [COLLATE ...];Change the default character set of the table and all character columns (Char,varchar,text) to the new character
First, the operation of the table1. View all TablesShow tables;2. Create a tableCREATE TABLE table name (field 1 type 1 constraint 1, field 2 type 2 constraint 2);3, modify the name of the tableRename table name to the new name;4. Delete a
Qps-query per secondTps-transaction per second is not a particular concern, and the transaction standards are not the same in each business scenarioⅠ, Sysbench test frameworkⅡ, common test scripts[[Email protected]_42_63_centos lua]#
Mysql> Select Host,user from user where host<> ' localhost ' into outfile '/root/aa.txt ';ERROR 1290 (HY000): The MySQL server is running with the--SECURE-FILE-PRIV option so it cannot execute this statementMysql> Show variables like '%secure% '; +--
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