1. Export a table to a text file
Command: Select * From tablename into OUTFILE 'a.txt'
// Note: a.txt can be replaced with your own path, for example, D:/mydatabase/a.txt. If no path is added, it is saved to the directory where the database table
Because the default value of the current MySQL field does not support functions, it is impossible to set the default value in the form of create_time datetime default now () . the alternative solution is to use the timestamp type instead of the
Today I have compiled two practical commands to easily solve the import and export problems.
First, export the command1. Export the databaseMysqldump db_name-uroot-P>/path/db_name. SQL2. Export a table in the databaseMysqldump db_name
By default, remote connection is not allowed for ysql, because of the high security risks.
You need to manually add remote accessDatabase.
Method 1. log on to MySQL locally, change the "host" item in the "user" table in the "MySQL" database, and
Business scenario:The background supports online mobile phone update system, 16 gb db Server Memory, 8-core, Dell PC server.QPS:About 200TPS:1 minute or so
Sort_buffer_size = 32 m, 8 m
Read_buffer_size = 32 m, 8 m
Read_rnd_buffer_size = 16 m, 8 m
Respect the author and change fromXiao BinHttp://www.searchdatabase.com.cn/showcontent_53221.htm
There is such a table:
Create Table 'user _ group' ( 'id' int (11) not null auto_increment, 'uid' int (11) not null, 'group _
After I installed MySQL on windows, I didn't set it to enable MySQL automatically after I started it. After I restarted my computer, I found that I could not connect to the database.
The reason is that the MySQL service is not started. The method
On the Internet, you can use the sysv-RC-conf configuration method or the method of changing the S to start with K, because 10.04 connects the MySQL startup to/lib./Init/upstart-job, which calls the definition of boot in the/etc/init/MySQL. conf
MySQL open-source database has multiple important branches: MySQL cluster, MySQL 5.1, MySQL 5.5, and MySQL 6.2. Each branch has the same MySQL database version: Development version, alpha version, beta version, RC version, and GA version. the
From the example in the previous article JDBC connection to MySQL database and example (go to this Article), we mentioned that using statement to execute SQL statements, such as connection; statement statement ;...... statement = connction.
------------------------------- Basic Introduction At the beginning --------:Stored procedures usually have the following advantages: [review/update/memory/resize/reference] -- How much memory does your brain have?(1) stored procedures enhance the
Database operations have become very useful in current python, with a set of API standards. Module Interface
The format of parameters in connect (parameters...) is as follows:
DSN Data Source Name User Name (optional) Password (optional) host Host
Install Apache, MySQL, and PHP on Ubuntu
1: first install Apache: Open the terminal (CTRL + ALT + T ),
Run sudo apt-Get install apache2,
After installation, open your browser and enter localhost or http: // 127.0.0.1 in the address bar.
If you see
[Comment] Before compiling and installing MySQL 5.6.x, the minimum packages required are: Bison, GCC, GCC-C ++, cmake, and ncurses-devel,After installing these dependency packages, delete the original MySQL source code directory, decompress it again,
A friend asked me, "Hi, I want to ask what urgent measures do you take when the single-host load is too high? "
I asked him if he was a MySQL db server?
He said yes.
I give him the following suggestions:
1. Check whether the mysqld process causes
// Display the slow Query Count
Show status like 'slow _ queries ';
① How to locate slow queries
Building a large table (4 million)-> building a stored procedure
By default, MySQL considers 10 seconds as a slow query.
L modify the slow query of
0. Check the database version SQL> status;1. Net start MySQL // start the MySQL Service2. net stop MySQL // stop MySQL Service3. mysql-H host address-u user name-P User Password // enter the MySQL database4. Quit // exit MySQL5. mysqladmin-u
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