1. Copy the table structure and data to the new table create table new table select * from old table this method will copy all the content in oldtable, of course we can use Delete from newtable; to delete. However, the worst thing about this method
Use this table for testing
Create Table 'test '. 'word' ( 'id' integer unsigned not null auto_increment, 'word' varchar (45) not null, Primary Key ('id'), unique index 'index _ 2' ('word') ) engine = InnoDB;
Check that the word has
1. Set phpMyAdminLanguage: Chinese Simplified (zh-utf-8)MySQL Character Set: UTF-8 Unicode (utf8)MySQL connection verification gbk_chinese_ci
2. When creating a databaseSet it to gbk_chinese_ci.
3. Create a table using SQLEngine = MyISAM default
1] how to create a management user for the mysqld database?
After the database is installed, we should create a management account for the mysql database. To set the root user as the administrator, we should run the following command;
[Root @
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
Let's start with a common example:
1. Get the current time and format it.
DECLARE I INT;SET I = date_format (now (), '% Y % m % D ');
ADDTIME (date2, time_interval) // Add time_interval to date2
CONVERT_TZ (datetime2, fromTZ, toTZ) // convert the
Link: http://imysql.com/node/298
I have previously written about how to obtain MySQL procedure results through PHP. However, this method cannot adapt to multiple result sets. A multi-result set refers to multiple SELECT queries and multiple result
Efficiency Comparison Between select count (*) and select count (COL) (refer to the http://hi.baidu.com/wrjgg/item/f5b823b4e1dca79918469729 ):
1. Select count (*) from tablename is the optimal choice under any circumstances;
2. Minimize select count
MySQLMedium, singleStore procedure (SP)Not an atomic operation,OracleIt is atomic. The following stored procedure, even if the statement2Failed, statement1Will still beCommitTo the database:
SQL code 1-1:
Create table testproc (id int (4) primary
InOracleMedium,SequenceMultiple tables and multiple fields can share one unique value.MySQLThe auto-incrementing Column exists, which can basically meetPK. However, the auto-increment column has restrictions:
A.It can only be used for one field in
Sometimes, you do not want the stored procedure to throw an error and stop the execution. Instead, you want to return an error code.
MySQL
Supports exception handling by defining
Continue/exit
Exception Handling
Handler
To capture
Sqlwarning/not
Stored procedures often need to return multiple result sets.
Mysql
Directly Using
Select
Returns the result set. While
Oracle
You need to use a cursor to return the knot.
Result
Set. This point
Mysql
The following code outputs two result
I have been using Oracle databases all the time, so when designing CDM, the primary keys of tables not selected will automatically grow. This is only available in SQL Server and MYSQL. In Oracle, SEQUENCE is generally used to handle the problem of
First, go to www.mysql.com download MYSQL5.0: mysql-standard-5.0.16-linux-i686.tar.gz version is more suitable for us these talented birds!Then, enter the following command in the terminal:[Code] shell> groupadd mysqlShell> useradd-g mysqlShell>
When using MySQL, we often encounter table names that do not comply with the specifications or standards, but there is already a large amount of data in the table. How can we keep the data and only change the table name?You can create a table with
References:1. Data Table Name: popadv, which contains a field: ADV, which is used to store ad links. There are about 100 records.2. Try to achieve the average value based on the randomly selected advertisements, that is, the chances for these 100
[Compile]
Innodb is compiled as a plug-in by default in the form of Dynamic Links (*. so). You can./configure -- help | less to view details.
After installation, it will be placed in./lib/mysql/plugin. The parameters will be loaded later: --
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.