JSP tutorial connecting to the MySQL Tutorial database tutorial code
//Method One compiles the Dbconn.java using the JDK's Javac command to form the corresponding class file. = "cd /tomcat4112/webapps
Simple MySQL Tutorial Group Statistics statement Instance Code/*ID name code_id code_name is_true Score1 31, Handsome is 5.2 tickets, 32 grand, 4.3 31, Handsome is 4.4 Sheets 32 Lavish No 35 Lee 41 Handsome is 56 Lee 42 Lavish is 3
Take a look at
1. Back up MySQL:
Export a library to a SQL file
The code is as follows
Copy Code
Mysqldump db_name >/home/hx/backup/name.sql-uroot-p
Back up multiple libraries (using the-b parameter)
The code is
If you are not forgetting the password to modify the MySQL password method There are many, as the following
UPDATE User statement (Huitian record)
This must be done by logging into MySQL with the root account and then executing:
1. If you do not
The following is an example of the database "Ceshi"
1, connect the database
The code is as follows
Copy Code
Mysql-u username-p Password
2. Create/Delete Database
The code is as follows
Copy
MySQL serve is 5.1.x, the client is 5.0.x, with phpMyAdmin, there is always a hint that the version does not match, feeling bad. Use the Ports method to upgrade the client, no, no error. Said 5.1 and 5.0 conflict, can only be deleted first.
I. Problems
MySQL often reported 1203 errors, exceeding the max_user_connections limit;
Second, analysisServer has long and long connection mix
The code is as follows
Copy Code
Max_connections and max_user_connections
Problem one, the log log is too large will lead to MySQL prompts error writing file ' xxx ' (errcode:28) error, the solution is very simple.
1, clean up the disk, free space;2, SQL statement query the original table data is too large, optimizing
Use the command mode xcopy command to save the following code as a Bak.bat file.
The code is as follows
Copy Code
net stop MySQLxcopy D:/phpstudy/mysql/data/sql111cn/*.* d:/db_backup/%date:~0,10%//ynet start MySQL
One, time lag
DateDiff: To put it bluntly is to use the first time to reduce the second time, the order can not forget
The code is as follows
Copy Code
Select DateDiff (' 2012-08-08 ', ' 2012-08-13 '); ---5
Symptoms of damage
A typical symptom of a damaged table is as follows:1. When selecting data from a table, you get the following error: Incorrect key file for table: ' ... '. Try to repair it2. The query cannot find rows in the table or return
This way MySQL will automatically convert all table names to lowercase characters when created and found (this option defaults to 1 in Windows and 0 in Unix). Starting with MySQL 4.0.2, this option also applies to database names.
When you change
database-based page counter example The code is as follows:Copy code $ Db = mysql_connect ("localhost", "root", "qwaszx ");$ Query = "select * from num ";$ Result = mysql_db_query ("test", $ query );If ($ result ){$ R = mysql_fetch_array ($
// Database connection tutorial$ Link_id = mysql tutorial _ connect ("localhost", "root", "") or die ("connection failed ");If ($ link_id){// Select a databaseMysql_select_db ("my_test ");// The above is the connection part of the header database,
Mysql_field_seek is used in the record set returned by mysql_query and transferred to the record we specified. If yes, the current record is returned. If no, it is false;Mysql_field_seek syntax:Mysql_field_seek (data, field_offset)Parameters:Data:
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