One, using the MySQL slow query log location to execute inefficient SQL statements.When MySQL uses the slow query log to locate those SQL statements that perform less efficiently, and start with the--log-slow-queries[=file_name] option, Mysqld
1. Database operationsAfter entering the database, you should manage the database. The management database is done through SQL.SQL is a tool used to control and manipulate databases, a language used to communicate with databases. So, the statements
Kali Linux 2018.2mysql password modified after invalid,external Unable to connect problemKali Linux 2018.2 default MySQL database is mariadb, May and MySQL some minor changes, only need to do the following processing. Solution:Mysql-u root-pupdate
1, the table's primary key, the foreign key must have the index;2, the data volume of more than 300 of the table should be indexed;3. Tables that are often connected to other tables should be indexed on the connection field;4. Fields that often
I. mysqldump backup combined with Binlog log recovery MySQL backups generally take the form of full-Library backups plus log backups, such as performing a full backup every day, and a binary log backup every hour. This allows you to recover data to
1. DatabaseThe operation of the program requires a lot of data support, such as we want to calculate 1+2= in the program? , then we need to put the numbers 1 and 2 in memory, or even put them in a variable, before we can do the math.For example, we
first, the concept of the indexindex: Dictionary-like directory, set up the index can speed up the data lookup, the data constraints;Second, the index type:Primary KEY index: Guaranteed data uniqueness, cannot repeat + cannot be emptyNormal index:
Recover only test_db library from full backup mysql-uroot-proot test_db --one-database recover from full backup only operlog_20180620 Table structure of table from backup query restore table sed-e '/./{h;$!d;} '-E ' x;/create table ' operlog_20180
1. Stop the MySQL service; Locate the My.ini in the MySQL installation directory, locate the following fragment in the My.ini [mysqld], and add another line to the code:skip-grant-tables and save2. Start the MySQL service and log in to MySQL (no
The most commonly used SELECT statement in SQL, which is used to select data in a table.The knowledge points to remember are as follows:
SELECT Statement Format:
SELECT the column name to query from the table name WHERE
--Multi-table connection--write a query to query employee name, department name, work placeSelectEname,dname,loc fromemp,deptwhereEmp.deptno=Dept.deptno--Exercise 1--1, write a query, display all employee name, department number, department
1) cmd to start MySQL:Local:Server:2) Linux install MySQL locally via rpmNote: To install is two east, one is a server, a client, it must be installed first server and then installed the clientInstall the server:A package conflict was found and the
First, depending on your current operating system, there are also development tools to select the appropriate MySQL version. I choose the environment is WIN10 + vs2013Need to solve three problems: 1, download and install MySQL server, and log in to
One, backup and import of database1), Backup of the database1. Export the entire databaseMysqldump-u user name-p database name > exported file nameExample: Mysqldump-u dbadmin-p myblog >/home/zhangy/blog/database_bak/myblog.sql2. Export a
ALTER table: Add, modify, delete table columns, constraints, and other table definitions.
View column information: DESC table name;
Modify table name: ALTER TABLE T_book Rename to BBB;
Add column: ALTER TABLE name add column field
Using source xxx.sql for Linux and Mac systems can import test data directly (note that you must first switch to the current Xxx.sql directory),But in the Windows environment import will appear garbled error,Mainly because of the coding problem, the
Master-Slave replication principle
As master server master, each of its changes will be recorded into the binary log binarylog. (The server I/O thread is responsible for reading the master binary log, then writing itself to the relay log
I use the MySQL version is 8.0.11, compared to the new MySQL version of the encryption method is different from the old, resulting in a 1251 error.Solution: Open the terminal connection on the database and execute the following statement to resolve
Simply test if the MySQL API interface can be used#include #include int main () {int ret = NULL; Mysqlmysql; Mysql*connect;mysql_init (&mysql); connect = Mysql_real_connect (&mysql, "localhost", "root", "root", null,0, null,0), if (connect = = NULL)
Workaround (ERROR 1698 (28000): Access denied for user ' root ' @ ' localhost ') cannot be logged after MySQL installationSteps to resolve:[====>>https://www.cnblogs.com/leolztang/p/5094930.html1. sudo mysql-u root-P2.SelectUser, Plugin
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