mysql| function (1) mysql_connect (host, username, password);
returns a connection number.
Note: MySQL user password can vary depending on the user's machine IP address.
In addition, mSQL has no user name mechanism, so msql_connect only
It is often found that developers look up the statements that are not indexed or limit N, these no statements will have a significant impact on the database, such as a large table of tens of millions of records to scan all, or do not stop doing
Today found MySQL's master-slave database is not synchronized
First on the Master library:
Mysql>show processlist; Check to see if the process is too much sleep. Found to be normal.
Show master status; is normal.
Mysql> Show master status;
+----
First set up the MySQL master server:
To create a user from the server on the primary server:
1.grant replication Slave on *.* to 192.168.0.1 identified by ' 1234 ';
#4.1 with this, before you can use file.
#grant file on *.* to 192.168.0.1
Create a data table of this structure and insert 1.1 million random records for query performance testing.
After inserting 1.1 million random records, the size of the datasheet is 102MB.
Now use phpMyAdmin's own SQL query
First, get the total number of processes under MySQL user
Ps-ef | awk ' {print $} ' | grep "MySQL" | Grep-v "grep" | Wc-1
Second, host performance status
# uptime
[root@ ~]# Uptime
13:05:52 up, Min, 1 user, Load average:0.00, 0.00, 0.00
Third,
MySQL Release results Memory code example
Definitions and usage
The Mysql_free_result () function frees the resulting memory.
If successful, returns True, or False if it fails.
Grammar
Mysql_free_result (data) parameter description
Data
Problem status
Restart MySQL is also a failure, look at the errorlog of MySQL, you can only see the following information similar to:
Forcing close of thread 12232 User: ' Root '
With mysqladmin simple monitoring of the next MySQL situation:
Note: The content of this article involves modifying NTFS disk permissions and setting security policies, and make sure that you understand the possible consequences of the operation before you make any changes. The permissions mentioned in the
Hint: "Starting MySQL ... error! Manager of Pid-file quit without updating file "solution.
After you delete the MySQL binary log file, restarting MySQL appears this error, because the disk space is small, those binaries occupy a lot of space. So to
Several MySQL statements commonly used in PHP
To display a database or table:
Show databases;//can then use database_name;
Show tables;
Change table name:
ALTER TABLE table_name rename new_t;
To add a column:
ALTER TABLE table_name ADD column
js|mysql| problem Green Start:
JSP's request defaults to iso8859_1, so when dealing with Chinese,
If you want to display Chinese, you must turn it into GBK, as follows
String Str=new string (Request.getparameter ("name"). GetBytes ("Iso8859-1"),
Environment: MySQL Sever 5.1 + MySQL command line tool
Problem: Using the command line to query the data in the database appears garbled.
Solve:
Set names UTF8;
-is equivalent to
set Character_set_client=utf8;
Set
The following statement has the same permissions as the root user. We should have met when we were taking the station. Root user MySQL, can only be local to connect, external deny connection.
The following methods can help you solve this problem,
Today there are operations of the classmate response, a business master-slave Replication (a main two from) a large delay;
MySQL master:5.0.82 slave:5.0.88
First point out that the DB data volume or dozens of g size, the network is not a problem,
This article mainly introduced the MySQL Delay Association performance optimization method, this article explained the delay correlation background, the delay correlation analysis, the delay correlation solution and so on content, needs the friend
What is a collection operation?
Generally, a join operation is considered a horizontal operation between tables because the operation generates a virtual table that contains columns from two tables. And I've summarized the set operations here, and
MySQL's default encoding is Latin, every time the JSP production page inserts the database with INSERT statement, Chinese characters will appear as question mark, after installing MySQL, start service and login, use show variables command to view
MySQL compilation parameters and complex, so that novice feel very head, if it is a formal environment installed MySQL, not enough time to study the meaning of each parameter, personal recommendations to use Yu Hongchun predecessors collation 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