1. MySQL Common commands Create Database Name; Create a database
Use databasename; select database
Drop database name directly deletes the database, no reminder
Show tables; displays tables
Describe tablename; Detailed description of the table
Add
Locate (substr, STR)
Position (substr in Str)
Returns the position of the substring substr that appears for the first time in the STR string. If the substring substr does not exist in STR, the return value is 0:
Mysql> select locate ('bar',
The output result of the processlist command shows which threads are running. This command can be used to identify problematic query statements.
1. Enter mysqladmin processlist In the MySQL/bin directory;
2. Start MySQL and enter show
To prevent security risks, we generally set an independent database access account for each database. This account has only the permission to access the database. Here is a detailed demonstration:
1. First, we need to log on to PhP (as the
1. Create a database table:
CopyCode The Code is as follows: Create Database Club;
Create Table member (
Id int (11) not null auto_increment,
No varchar (5) not null,
Name varchar (10) Not null,
Age int (2) not null,
Level varchar (10) Not
I once
Used backup methods include mysqldump, mysqlhotcopy, backup table, and select.
OUTFILE, or BINLOG backup, or directly copy data files and related configuration files. MyISAM
Tables are saved as files, so they are relatively easy to back up.
Recently, it has always been a headache to initialize data for the current project, and the auto-increment of database IDS is getting bigger and bigger, so we need to re-start auto-increment from 1: use the following method:
Method 1: If no data
1. PHP
A. PHP-> HTML & JavaScript
The amount is too simple. I want to write = ~
Html code
/>JavaScript codeCopy codeThe Code is as follows:
B. PHP MySQL
Php codeCopy codeThe Code is as follows: $ Dbcnx = @ mysql_connect ("localhost", "root", "12
After configuring MySQL 5.1.48 or MySQL 5.5.8, click Execute, but the Start service step is not completed. Check that the MySQL System Service has been added but cannot be started. At this time, we can use the Event Viewer to see several MySQL
The number of split fields must be limited. Therefore, it is impossible to store an infinite number of characters in a string.The table to which this field belongs is associated with this field. It must be a one-to-many relationship.For example, the
For comparison, the first step is to use the mysql stored procedure:
Copy codeThe Code is as follows: mysql> delimiter $
Mysql> set autocommit = 0 $
Mysql> create procedure test ()
Begin
Declare I decimal (10) default 0;
Dd: loop
Insert into
Question: Why is transaction introduced?
1>.Data Integrity
2>.Data security
3>.Make full use of system resources to improve the system's concurrent processing capability
1.Transaction Features
Transactions have four features: Atomiocity, Consistency,
Automatically generate a class file based on the fields in Mysql:
But you need to import:
Require_once./db/ez_ SQL _core.php;Require_once./db/ez_ SQL _mysql.php;
Help document: http://jvmultimedia.com/docs/ezsql/ez_ SQL _help.htm
:
Core code:
Copy
We will continue to use the previous example. The preceding table contains basic information about an employee, such as name, gender, date of birth, and place of birth. Create another table to describe the articles published by employees, including
Next, let's take a look at how to restore the two ..
If slave_io_running is no, I personally think there are three situations. One is that there is a network problem and the connection fails. For example, I once used a virtual machine to build
1. Check whether the firewall on the server does not block port 3306.
The default port of MySQL is 3306. Make sure that the firewall does not block port 3306. Otherwise, the remote connection to MySQL cannot be established through port 3306.
If you
Because the database records may need to be reordered. In this article, I will talk about two ideas to improve the query efficiency of Order By statements for your reference.
In MySQL databases, Order by statements are frequently used. However, it
MySQL databases can be said to be one of the most common and common databases for DBAs. The wide application of MySQL also adds more people to the ranks of them. The following are some of the most common and frequently used MySQL Databases
As the company's website traffic grows, MySQL naturally becomes a bottleneck. Therefore, I have been studying MySQL optimization recently. The first step is to naturally think of MySQL system parameter optimization, as a database system for a
For many new users, using PHP can easily write code with specific functions in just a few hours. However, building a stable and reliable database requires time and related skills. The following lists the 11 most serious MySQL-related errors I have
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