Recently encountered such a problem: it is required to delete repeated records in the table. Specifically, for example, if a user table does not have a primary key, the user name can be repeated. In this case, a user name is input several times and
Recently, I used MySQL ++ to access the MySQL database. After downloading the source code, I checked it and found that some code is very elegant.So post it and share it with you.
Brief Introduction to MySQL ++MySQL ++ APIs are a group of C ++ APIs
SQL code
-- Or database shard backup, but what if I want to exclude the specified database from the first database? -- Do you have to control the for loop by logic judgment? -- instead, I first use SQL statements to get the names of all the
I originally intended to use mysqlslap of MySQL for stress testing. Unfortunately, this tool is not powerful and there are not many controllable items, especially random test statements. Use super smack instead. It seems that it is not bad.
Install1.
1. sudo apt-Get install mysql-server mysql-ClientUse sudo netstat-Tap | grep MYSQL: Check whether the service is enabled:TCP 0 0 localhost. localdomain: MySQL*: * Listen-
For exampleIf the service is not running, you can useSudo/
========================================================== ==================
Part B: Building libevent--------------------------
1, CD/root/2, tar-xzvf libevent-1.4.8-stable.tar.gz3, CD libevent-1.4.8-stable4,./configure5. Make & make install6,
Enable MySQL binary log in Windows
1. Enable binary log
Change my. ini
Find [mysqld] and enter the following command
# Enable binary logs
Server-id = 1
Log-bin = E:/mysqlbin/BINLOG. Log
Log-bin-Index = E:/mysqlbin/BINLOG. Index
Restart
I wrote several web pages in PHP and directly used built-in functions to connect to the MySQL database. A practical requirement is that there are several similar tables (including news and announcement articles) that want to make a common query and
Happy to see MySQL 5.5.8 GA, and upgrade 5.5 today, I am unable to connect to MySQL remotely, and the error message is as follows:
Error 1042 (hy000): Can't Get hostname for your ad[Root @ localhost ~] # Mysql-H 192.168.1.10-u root-PEnter
Indexes are the main means to accelerate table content access, especially for queries involving connections to multiple tables. This is an important part of database optimization. We need to understand why indexes are needed, how indexes work, and
Garbled characters are generated when Chinese characters are stored in the MySQL database. garbled characters are generated when MySQL Chinese data is read from the JSP page, and garbled characters are displayed when the Chinese data of the database
1. MySQL encounters garbled characters
Solution:Show variables like 'collation _ % ';
Check whether the encoding is the same as the data encoding in the program. If the encoding is different, there are two solutions:
A.
B. Set names 'gbk'Alter
As early as the end of last year, I was preparing to write this article. CTO Zhang also suggested that I share this article several times. However, for personal and work reasons, it is not until today that we have time to sit here to share with you.
Today, I read MySQL documents and some online articles and learned how to process binary data in MySQL. Many examples are used to access image data, however, what I want to access is not image data, but it does not matter. It is binary data and
Go to the command line, Windows cmd, and connect:
Mysql-u username-P password-H Server IP address-P server MySQL port number-D database name
Note:
(1) The server port flag-P must be larger to distinguish it from the user-P. If you directly connect
1. Data Files1) MyISAM Table: There are three related files, data file. MYD, index file. myi, target file (definition file). FRM2) bdb table: contains two files, one. DB data file and one. frm target file.3) InnoDB table: it has its own target file.
Version:
--- Windows 2000 Professional--- Apache 2.0.50 (apache_2.0.50-win32-x86-no_ssl.exe)--- PHP 5.0.2 (php-5.0.2-win32.zip)--- MySQL 4.0.21 (mysql-4.0.21-win.zip, and the installation package containing setup.exe is decompressed)
Tip:
1. Other
MySQL cmd command
Connection: mysql-H host address-u user name-P User Password (Note: U and root do not need to add spaces, the same is true for others)
Disconnected: exit (Press ENTER)
Create authorization: grant select on database. * To username @
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