In Linux, configuring MySQL Databases on Tomcat is not as simple as windows... Therefore, it is worth writing down a record for future reference.
1. Download and install MySQL
Installing MySql in Ubuntu is very simple. You only need:
Sudo
If the persistent class contains a String object containing Chinese characters, the corresponding Chinese characters in the database will be garbled. This is mainly because the character set of the MySQL DATA table is different from the local
1. Use mysqldump to export data
Mysqldump-uuser-ppasswd database table -- where = "condition"> output file name
Example:
D:/> mysqldump-uroot-p123456 dbname tbname -- where = "id> 100"> data. SQL
Note: 1. Double quotation marks are used
This small problem is always complicated, but it is still reliable to record.
I downloaded and tried compiling MySQL ++-3.1.0. I am inserting ing thefollowing error: src/MySQL ++-3.1.0/BK-deps g ++-c-o mysqlpp_ SQL _buffer.o-I.
Recently, MySQL in Ubuntu has encountered some problems. I have not found the answer for a long time on the Internet, so I uninstalled and reinstalled it. Of course, as the title is written, encoding is also involved here.1. Uninstall
When I first
Remote connection to MySQL is slow. Sometimes it takes 4-20 seconds to remotely connect to MySQL. The local connection to MySQL is normal. The main cause of this problem is that the reverse DNS resolution is enabled for the MySQL instance installed
Oracle's fast return mechanism has been very tangled. Although there are many result sets, it can quickly display the first result. Although it can be done through the mysql client, it cannot be achieved through JDBC.
It took more than an hour today
Currently, MySQL's extension solutions mainly include object-based memcached, high-performance embedded database programming library Berkeley dB, and powerful full-text search engine Lucene.
I. Rational Use of the third-party cache solution
Add a user to MySQL, create a database, authorize the user, delete the user, and modify the password (note that each line is followed by a command; it indicates that a command statement ends ):
1. Create a user
Log on to MySQL:
@> Mysql-u root-P
@
Install MySQL
Sudo apt-Get install mysql-Server
This should be very simple, and I don't think there is much problem with the installation, so I will not talk about it much. Let's talk about the configuration below.
Configure MySQL
Note: In ubuntu,
Generally, the most basic paging method of MySQL is as follows:
Select * from content order by id desc limit 0, 10
In the case of small data volumes, such SQL statements are enough. The only problem that needs to be paid attention is that indexes
MASTER:Show Master Status;-view status:Show processlist;-view MySQL process information under slaveReset master; # Use with caution to clear logs and synchronize the position
Slave end:
Change master to master_log_file = 'master. 100 ′;Show slave
Why does my MySQL support Chinese Query?
Q:When I write a query condition, the problem is as follows:For example, if I want to write all records whose fields contain the word "Li ",$ STR = "Li ";Select * from table where
Microsoft's Visual Studio does not have a built-in connection to MySQL driver, go to the Internet to download a mysql-connector-net-6.4.3 driver, and then the installation can be used.
The following is my encapsulated database connection class,
To optimize MySql in high concurrency, it is necessary to understand the lock table mechanism when MySQL queries an update.I. OverviewMySQL has three levels of locks: Page, table, and row.The MyISAM and memory storage engines use table-level locking.
Select... Like %... % To find
MySQLThe text field is a Chinese character, but it is found that it is messy, and many people have encountered such problems.
When sorting and searching Chinese characters, the results of Chinese characters are
Modify full-Site Search
Modify my. ini (My. CNF), In[Mysqld]Add a line "ft_min_word_len = 1", restart MySQL, and then log on to the website background (module management->Full-text index reconstruction.
Record the slow query SQL statement, modify
MySQL has provided profiler tools since 5.0.37, which is often useful for performance debugging. The primary purpose of profiler is to display the consumption of resources in the entire process of executing an SQL statement. The parser can better
When writing SQL statements, some statement aliases cannot be called. Baidu's reasons are due to different alias mechanisms. To avoid making the same mistake again next time, todaySummary of the information found on the internet, SQL and MySQL
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