The use of PHP code to implement database backup can make the site management becomes very convenient, we can directly into the background operation can complete the database backup.Key technologies:
1. First you have to get the tables in the
Here is a PHP link to the MySQL database
PHP and MySQL link and query the whole process
1. Compounding:
php.ini load MySQL component:Before the Extension=php_mysql.dll; RemoveExtension_dir = "" Path is correct
2. PHP syntax
PHP link MySQL
Direct cmd command mode using
The code is as follows
Copy Code
show databases;Show tables from db_name;Show columns from table_name to db_name;Show index from Talbe_name [from db_name];Show status;Show variables;Show
Principle Steps
1,php use mysql_connect to connect with MySQL database
2, open MySQL database
3, accept the page data, PHP input to the specified table
4, and then use Mysql_query to execute and save the SQL to the database.
Connection MySQL
The code is as follows
Copy Code
Class connectionmysql{HostPrivate $host = "localhost";Username of the databasePrivate $name = "root";Password of the databasePrivate $pass = "";Database namePrivate $table = "phptest";Encoded
Php
int value:Time (): is the number of seconds to return from the Unix era (GMT January 1, 1970 00:00:00) to the current period.We want to obtain the number of seconds from January 1, 1970 to 2012-2-10 can be achieved by strtotime (): namely:
1. Create a database connection2. Send some statements that are not necessary3. Select a stored database4. Write the database INSERT statement5. Send this statementLook at the data structure first
The code is as follows
Copy Code
MySQL supports a large number of column types, which can be grouped into 3 categories: numeric types, date and time types, and string (character) types. This section first gives an overview of the available types, summarizes the storage requirements
Look at its grammar first.
The left JOIN keyword returns all rows from the left-hand table (TABLE_NAME1), even if the right table(table_name2) does not have a matching row.
Left JOIN keyword syntax
The code is as follows
Copy Code
Failed to create TABLE #1005Failed to create DATABASE #1006Failed to create database #1007 database already existsFailed to delete database #1008 database does not exist#1009 Unable to delete database file causes database failure to be deleted#1010
The first method:
Of course increase your wait-timeout value, this parameter is set in MY.CNF (My.ini under Windows), my database load is slightly larger, so I set the value to 10, (this value is the unit of seconds, It means that when a database
Error message#1045-Access denied for user 'root' @ 'localhost' (using password: YES)Find the config. inc. Php file in the phpmyadmin directory and modify the following location:For the config. inc. Php file, the most important thing is to modify the
I. What is table partitioning?In general, table partitioning refers to dividing a large table into several small tables based on conditions. Mysql5.1 began to support data table partitioning. For example, if the number of records in a user table
Mysql master/slave databases are not synchronized todayFirst go to the Master database:Mysql> show processlist; check whether there are too many Sleep processes. It is normal.Show master status; also normal.Mysql> show master status;+ ---------------
= Start =Reason:Work needs, learning needs.Body:MySQL master/slave architecture:One MySQL instance acts as the master database and receives read/write requests. Another or more MySQL instances synchronize data from the master database to the slave
MySQL dual-master-High AvailabilityResource PlanningHost name OS version MySQL version host IP address MySQL VIPDb01.lyk.com centos 6.4 mysql-5.6.21-linux-glibc2.5-x86_64 172.31.30.12 172.31.30.222Db02.lyk.com centos 6.4
When I first came to the company today, the developers told me that mysql could not be started. I only knew that he had restarted all the services on the test server. At that time, I was so angry, I want to give him 124. If you say you want to
If you want to directly store binary data, such as image files and HTML files, in your MySQL database, this article is for you! I will show you how to store these files through HTML forms and how to access and use these files.Overview:Create a new
Instance 1. Obtain the MYSQL version#-*-Coding: UTF-8 -*- # Install mysql db for pythonImport MySQLdb as mdb Con = None Try:# Method for connecting to mysql: connect ('IP', 'user', 'password', 'dbname ')Con = mdb. connect ('localhost', 'root', 'root'
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