Tree output
function Get_array ($user _id, $top =0) {Global $mysql, $_g;$sql = "Select user_id as name from ' {spreads_users} ' where p1.spreads_userid= ' {$user _id} '";$rows = $mysql->db_fetch_arrays ($sql);if ($top ==1) {$arr [0][' name ']=
Here is the file code for backing up the MySQL database via apache+php under Linux:File one, listtable.php (file lists all tables in the database for backup selection)Please select the table you want to back up:
The code is as follows
1.SELECT Count (*) from ' feed ' WHERE ' uid ' =1121293
You can return the total number of eligible records
The following method is recommended by me.
SQL statement: Select 1 from tablename where col = col Limit 1;
The number of rows affected by
Write a MySQL backup script, let's see what's wrong with the place.
This is the first shell script I wrote, so let's see,
I can send it to whoever needs it.
You can put this script into the crontab, perform it once every morning, and automatically
Reasons for Memcache:1.Web Server (LIGHTTPD, Nginx is said to be more efficient than Apache, you can try) on the CPU requirements high, low memory requirements, and memcached Server is low CPU requirements, high memory requirements, so you can use.
?/* Store the table structure of the posts------------------------------------------------------
The code is as follows
Copy Code
CREATE TABLE Bbsrow (bbsrow_id Int (6) NOT NULL auto_increment,//posting ID
Specific methods
1. Stop mysqld
1.
The code is as follows
Copy Code
Service Mysqld Stop
2. Modify MY.CNFIn [mysqld], change the datadir=/var/lib/mysql to Datadir=/home/mysql and change
MySQL is a small and medium website perfect database solution. If your backend MySQL database is as well as the proper structure optimization and it can be for thousands of visitors every day will not degrade server performance. In this article, I
1. Partition column index constraintsIf the table has a primary key or unique key, the partition column of the partition table must be included in the primary key or unique key list to ensure the efficiency of the primary key, otherwise, the same
1. User creation, permission, and deletion1. Connect to MySqlConnection: mysql-h host address-u user name-p user password (note: u and root do not need to add spaces, the same is true for others)Disconnected: exit (press enter)Open cmd and
1. BasicsMemcache is a high-performance distributed memory object cache system. It maintains a unified huge hash table in the memory and can be used to store Sessio. When the system needs to read data from the memory, this greatly improves the
1. Query duplicate records based on a single field (name) in the tableSELECT * FROM user WHERE name IN (SELECT name FROM user group by name having count (name)> 1 );2. Delete duplicate records based on a single field (name) in the table. Only
Background:In some technical groups, we can see that some O & M personnel still use commands such as mysqldump to back up MySQL, so we feel it is necessary to introduce innobackupex.Currently, most MySQL-based scenarios use the Master-Slave
Select distinct can remove duplicate records. Disctinct ignores duplicate records, but it ignores completely consistent duplicate records, rather than the record where one of the fields is repeated, or it can be used to query a field by distinct, it
For example, in linux$2 User column in the second horizontal column The code is as follows:Copy code For I in $ (mysql-uroot-p123456-se "show processlist" |Awk '{if ($2 = "admin") print $1}'); do mysql-uroot-p123456-e "kill $ I"; doneExample:
It is very sad to lose the password, especially the root password :(. I lost my own installation and play, but it would be too much trouble if the server crashes! It is assumed that the root password is lost due to intrusion. Here I will talk about
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
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