Install MySQL
Sudo apt-Get install mysql-Server
This should be very simple, and I don't think there is much problem with the installation, so I will not talk about it much. Let's talk about the configuration below.
Configure MySQL
Note: In
Method 1: Use mysqldump -- no-data to export the SQL statement for creating the database and table, drop the database, create the database, execute the exported SQL file, and create the table. Method 2: generate sqlmysql-n-s information_schema-e
~~ Syntax ~~
CreateTriggerTrigger name> -- The Trigger must have a name and a maximum of 64 characters. It may be followed by a separator. It is similar to the naming method of other objects in MySQL. {Before|After} -- Trigger has the execution
PHP: Server scripting language
PHP Runtime Environment (installation required ).
Supported OS: 5.4 (inclusive) supports WINXP and winserver, and later does not support
Apache: Web Service Release Software
Developer: National Computer
*Use mysqldump to back up the database, upload it to the backup server through FTP, and retain the backup file locally.
Create a shell script file
VI/home/work/backup. Sh
Add the following content:
# ! /Bin/bash Sqlbakname = _ U1_ SQL _ $ (
ArticleDirectory
Configure master
Configure slave
Connect master and slave
High Availability MySQL p10 MySQL master-slave Replication
MySQL replication is often used in the following environments:
1. Avoid
Install MySQL using the RPM package and set iptables for TCP port 3306.
Root Password Management sets the root user's password mysqladmin-uroot password 'Password '.
Modify the root user password mysqladmin-uroot-P password 'Password '.
By default, httpd and MySQL are not started,
For example, if you directly use the MySQL command => 〉
Can't connect to local MySQL server through socket '/var/lib/MySQL. Sock'
A: Use YaST to start the desktop directly in system> service.
B:
Install MySQL first
Code: Sudo apt-Get install mysql-server mysql-Client
Reinstall the Development KitCode:Sudo apt-Get install libmysqlclient15-dev
After installation, add the header file to the C code.Code:# Include
Compilation
What is an index? Indexes are used to quickly search for records with specific values. All MySQL indexes are saved as B-trees. If no index exists, MySQL must scan all the records of the entire table from the first record until the required
Http://tech.ccidnet.com/art/321/20060817/832025_3.html
The connection type is the same as that of all. The difference is that it only scans the index tree. It is usually faster than all because the index file is usually smaller than the
eq_ref one row will be read from this table for each combination of rows from the previous tables. other than the const types, this is the best possible join type. it is used when all parts of an index are used by the join and the index is a
(7) Table Optimization1. select an appropriate Data EngineMyISAM: Suitable for reading a large number of tables.InnoDB: Suitable for writing and reading a large number of tables 2. Select the appropriate column typeYou can use select * From tb_test
In the past, Oracle was rarely used for its collation method. However, in MySQL, problems may occur if you do not pay attention to this.
The problem is as follows:
A test table. The character set uses latin1.
Select to_id from test where to_id
Http://lib.xiaop.net/article/mysql-optimization/
1. select the most suitable field attribute
MySQL can support access to large data volumes, but generally, the smaller the table in the database, the faster the query will be executed on it.
The service cannot be deleted during MySQL installation. An error occurred while starting the service. cocould not start the service mysql. Error: 0
Check the service in the control panel and there is a MySQL service (the name may be another
From http://www.diybl.com/course/4_webprogram/php/phpjs/2008410/109222.html
HtmlspecialcharsConvert special characters into HTML format.
Syntax: String htmlspecialchars (string );
Return Value: String
Function Type: Data Processing
It is fast enough to run a common MySQL with a small amount of data and traffic. However, when the data volume and traffic volume increase sharply, it is obvious that MySQL is slow or even down, we need to consider optimizing our MySQL.
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
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