Whether in a small, free database space or a large e-commerce site, a reasonable design of the table structure, the full use of space is very necessary. This requires us to have a good understanding of the common data types of database systems.
The code is as follows
Copy Code
Categories Directory tree $globals ["id"] = 1; The ID number used to track the Drop-down menu$layer = 1; The series used to track the current menuConnecting to a database$con =mysql_connect
MySQL usage guide (ON)
Author: King Kong
Many friends have installed MySQL but do not know how to use it. In this article we will learn some common MySQL commands by connecting MySQL, modifying passwords, and adding users.
One, the connection MySQL.
Author: Wang Mei (HeartIcy@163.com)
The loss of the password is very distressing things, especially the root password lost: (. Install yourself
Play lost also lost, but in the event of a production server hanging trouble can be big!
Now assume that
First, install MySQL. This should not be said much.
Then confirm that My.ini,linux is my.cnf. There is no skip-networking in the document, or the sentence is annotated. Now it seems to be installed after the default is not. (if modified, restart
MySQL server has gone awayThe most common cause of gone away errors for MySQL server has is that the server timed out and closed the connection. By default, if nothing happens, the server closes the connection after 8 hours. You can change the time
CONCAT () is a string concatenation functionReplace () is a string substitution function
CONCAT (parameter 1, parameter 2,...)
CONCAT (String, FROM_STR,TO_STR)Returns the string str, where all occurrences of the string from_str are replaced by
This article describes how to check the MySQL database, view the current date, using the MySQL current_date variable.
We can execute SQL statements when we log on to MySQL using the MySQL client tool or other graphical tools. If we want to look at
If you forget the root password can be modified by the following method
Note--skip-grant-tables can turn off permission validation
1. Modify the MySQL configuration file under [mysqld] Add a line of configuration--skip-grant-tables, restart MySQL
The company's database storage engine was all MyISAM, data volume and access is not very large, so there is no problem. However, the recent occurrence of the MySQL data table is often locked, directly caused the user to connect the site timeout and
When it comes to MySQL's execution, it has to say its execution process. And its execution process is divided into standard execution process and optimized execution process.
Standard processStandard processes are standard processes for SQL
The ORDER by null purpose is to force the ordering to be disabled for query results. When you check the query by explain, if you see a using Filesort in the extra column, this has a certain effect on performance, especially when group by is used,
Originally my idea is to use PHP for the loop to execute the SQL statements more than once, but later a thought, doing so in the data is not much good, if more data, query so many times do not know how much resources to consume.
After trying to
MySQL UPDATE statement Base usage
Updating data in a database
The UPDATE statement is used to modify data in a database table.
Grammar
The code is as follows
Copy Code
UPDATE table_nameSET column_name = New_valueWHERE
If there are many tables that need to be deleted, and the table has the same prefix, we might need the following statement:
The code is as follows
Copy Code
drop table pre_tablename1;drop table pre_tablename2;drop table
Show tables or show tables from database_name; Displays the names of all tables in the current database tutorial
show databases; Displays the names of all the databases in the MySQL tutorial
Show columns from table_name to database_name; or show
Textarea always has a lot of space issues to solveProblem description:There is always a lot of space at the end of the header when php reads mysql data to textarea. There is no space in viewing data in the data table.Cause:The content should be
To solve the problem of garbled characters inserted into the Chinese database:Most of the problems are caused by converting Chinese into UTF-8. The code is as follows:Copy code $ Str = iconv ('gbk', 'utf-8', $ str ); If not, check whether the
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