When using MySQL, you must pay attention to security issues. The following are 23 notes for MySQL:
1. If the connection between the client and the server needs to span and pass through an untrusted network, you need to use an SSH tunnel to encrypt
Refer to the followingArticle
Http://www.mysqlperformanceblog.com/2010/03/23/too-many-connections-no-problem/
Conclusion:
(1) MySQL will leave a connection for the Super User by default. You can use this reserved connection to log on and
Sometimes we store the largest ID in the database, and this ID is automatically added whenever there is a new record.
Create the following table:
Create Table maxidtest ('id' int (10) unsigned not null auto_increment, 'name' varchar (100) not null,
Show all databases: Show databases;
Create Database customer; customer is the database name;
Open Database: Use customer; open the database before you perform various operations;
Customer table ID number name gender age birth date salary phone
To connect to the server, a MySQL user name and password are usually required when MySQL is called. If the server is running on the Login Server
You also need to specify the host name on other machines. Contact the Administrator to find the
There are two ways for MySQL to copy the same table structure: Create Table as and create table like. What is the difference?
Create Table T2 as select * from T1 where 1 = 2; or limit 0;
The T2 table (new table) created by as lacks the index
The data table of the experiment is defined as follows: mysql> DESC tbl_name; + ------- + -------------- + ------ + ----- + --------- + ------- + | FIELD | type | null | key | default | extra | + ------- + -------------- + ------ + ----- + ---------
Can't connect to local MySQL server through socket '/var/run/mysqld. Sock'. Let's talk about the solution: root @ zby :~ #/Etc/init. d/MySQL restart cannot be started. It may be the permission of/var/run/mysqld on the Internet. However, I installed
There are a lot of articles on how Delphi connects to the MySQL database. Here, I only record the methods I have tested for use.System Environment: Windows XP SP3Software environment: Delphi 7, mysql-installer-5.5.15.0
1. ODBC ModeYou must first
1. SelectTOP 50 PERCENT*From Persons ~~~ In the "persons" table, select 50% of the records;
SelectTOP 2*From Persons ~~~ Select the first two records in the "persons" table.
2. wildcard characters:
3. Select * fromPersons where lastname in
MySQL variables related to character sets include
SQL: Show variables like '% character %'
+ -------------------------- + ----------------------------------------------- +| Variable_name | value |+ -------------------------- + ---------------------
After nearly one day, I finally connected to the MySQL database. Here is a brief summary:
1. Configure the MySQL database first.
2. Download the MySQL driver mysql-connector-java-5-jar and add it to the current project
Package second; import Java.
1. MySQL encapsulates a layer of MySQL net protocol on top of TCP/IP. The relationship between MySQL net package and TCP package can be one-to-many or multiple-to-one;
2. Client sending:
A) client authentication package, the authentication request
Recently, I want to take over the online project of my new employee (running on Linux ).No UI.As a last resort, Linux, MySQL, and Java have been badly supplemented.
The installation in Ubuntu is very simple.I have tried to install a binary package.
We know that MySQL 5.1 supports horizontal partitioning. Let's try to optimize the query on a partitioned table.In general, the optimization principle is the same as the optimization for individual tables, ensuring that the number of scans on the
Invalid connection using Apache common DBCP + common pool + MySql
Throwable occurred: Org. springframework. transaction. cannotcreatetransactionexception: cocould not open JDBC connection for transaction; Nested exception is com. mySQL. JDBC.
Finally solved last week's legacy MySQL can not start the problem, the reason is that the previous installation of two MySQL, and the path is different, there are other people's detailed solution:
The MySQL version I installed under win7 is a mysql-5.0.22-win32
1. Install MySql in Windows 7. For more information about the installation method, see:Graphic tutorial on installing mysql5.5.21 in win7,Install MySql in win7
2. Add the bin in the
1. Text (clob)
In MySQL, the maximum varchar value is 65535 bytes. If the value exceeds this range, set it to text.
Longtext can be up to 4 GB
Store text // define SQL statement string SQL = "insert into clob (File) value (?) ";
Preparedstatement PS
1. Create a stored procedure
1. Basic Syntax:
Create procedure process name ([process parameter [,...]) procedure [feature...] process body
Example:
1. mysql> DELIMITER //
2. mysql> CREATE PROCEDURE proc1(OUT s int)
3. -> BEGIN
4.
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