For LNMP installations, each operational dimension may have been hundreds of times. Here's what I think is the simplest and most efficient installation scenario.
1. Upgrade Yum to the latest version:
The code is as follows
Copy
A. mysql database
The code is as follows
Copy Code
$conn =mysql_connect ("localhost", "root", "123456") or Die ("database connection failed");mysql_select_db ("test") or Die ("Select Database Failed");;$sql = "SELECT *
Example 1
MySQL functional function to achieve Pinyin query:Function: Enter the first letter of each word in Chinese string to retrieve the corresponding data.How to: Use Py directly (field name) = ' keywords '.
The code is as follows
The MYSQL LOAD Data infile command can import data from a CSV flat file into the database.If there is an import error, you should put the imported CSV file in the/tmp folder before you have any problems.
Method One, import data using the Load Data
First of all, it is an honor to find this article ...
If you have forgotten the MySQL password, try this method below.
1, open My.ini
The code is as follows
Copy Code
[Mysqld]port=3306#skip-grant-tables
Add
Replace replacement
The Replace function in MySQL directly replaces a specific string in a field in the MySQL database, and it is no longer necessary to write the function to replace it, which is very convenient to use. MySQL replacement function
The following error occurred while importing SQL into MySQL:
ERROR 1418 (HY000) at line 8752:this function has none of the deterministic, NO SQL, or reads SQL DATA in its declaration and Binary logging is enabled (your *might* want to use the less
The programs we write may require a large number of database operations. Databases are often the cause of bottlenecks.
Opening query statement caching is also a strategy to optimize MySQL.
MySQL is a common database for our development programs.
One, scheduled backup MySQL database
For security purposes, execute directly with root:
The code is as follows
Copy Code
/root/mysql_backup.sh# everyday 3:00 AM Execute database backup3 0 * * */root/mysql_backup.sh
For large databases, it is very quick to load the data into a table with no Fulltext index and then use ALTER table (or CREATE index) to create the index. It will be very slow to load data into a table that already has a fulltext index.1.
The code is as follows
Copy Code
Inquire TodaySELECT * FROM table name where To_days (Time field name) = To_days (now ());Yesterday SELECT * FROM table name WHERE to_days (now ()) –to_days (Time field name) 7 days SELECT * FROM
Instance
windows resolves MySQL Errno.: 1040 ErrorXXXX Info:can not connect to MySQL server
User:rootTime:2004-5-20 3:00pmScript:/xxxx/xxxx.php
Error:too Many connectionsErrno.: 1040
An error in the has been dispatched to our administrator.
01./*!40101 SET sql_mode= @OLD_SQL_MODE * *;02./*!40014 SET foreign_key_checks= @OLD_FOREIGN_KEY_CHECKS * *;03./*!40014 SET unique_checks= @OLD_UNIQUE_CHECKS * *;04./*!40101 SET character_set_client= @OLD_CHARACTER_SET_CLIENT * *;05./*!40101 SET
The use of the following methods:
The code is as follows
Copy Code
Mysql>load data local infile "d:/ab.txt" into table Mytbl (name,age);
How to load data with back slash (backslash) "" data
Because if you do
Grammar
The code is as follows
Copy Code
Case value when [compare-value] THEN result [when [compare-value] THEN result ...] [ELSE result] When [condition] THEN result [when [condition] THEN result ...] [ELSE result] End
The run of replace is very similar to insert. Except for one point, if an old record in the table has the same value as a new record for primary key or a unique index, the old record is deleted before the new record is inserted.
Note that it is
MySQL configuration file my.cnf Chinese version configuration Reference document
#BEGIN CONFIG INFO#DESCR: 4GB RAM, using only InnoDB, ACID, a small number of connections, large queue load#TYPE: SYSTEM#END CONFIG INFO
## This MySQL Tutorial
Check on the Internet most people are said to be the issue of permissions, the following we told two kinds of MySQL tutorial 1017 wrong solution, friends can refer to.
ERROR 1017 (HY000): Can ' t find file: (errno:13)
The reason is that the MySQL
Change MySQL database storage path and port in Linux
Suppose we change to the/opt/data directory to pour:
1, opt directory to establish the data directory
Mkdir/opt/data
2, stop the MySQL service process
Mysqladmin-u root-p shutdown
3.
200 MB website space 200 MB spaceUnlimited data transmission unlimited data trafficPOP3 email system supported by POP3 email accountsPHP and MySQL enable PHP support and MySQLFree second-level domain name address free second-level domain nameFree
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