When an external program accesses a database (for example, PHP), you organize a lot of SQL statements.
In particular, the complexity of business logic, a lot of SQL and conditions mixed in the PHP code, makes people shudder. Now that you have a
This article describes the MySQL regular batch check table repair and optimization table optimize the shell script, for MySQL database maintenance is very useful! As shown below:
#!/bin/bash
host_name=192.168.0.123
user_name=jincon.com
user_pwd=
Tables of the MyISAM type emphasize performance, which executes more than INNODB types faster, but does not provide transactional support, while InnoDB provides transactional support for advanced database features such as foreign keys.
Myiasm is a
This file is/tmp/phpbeojq5.
################# can copy this code to test #################
?
Include ("Include/dbclass.inc"); You can use MYSQL. INC class instead of testing
$q = new Db_sql;
$db = $q->database; Define the database
mysql_connect ('
Environment:
Master server: CentOS 5.2 mysql 5.1.35 source ip:192.168.1.22
From server: CentOS 5.2 mysql 5.1.35 source ip:192.168.1.33
Configuration:
First, the main server
1.1, create a replication user,
Php+apache+mysql Downloadphp Download:http://www.php.net into the PHP website after clicking download into the following interface. The above shows a different version of my choice is php5.6.19 version, this is more stable, if there is no version of
Download GPL version installation
MySQL Community Edition (GPL)
Community (GPL) downloads»
When we use the MySQL database, sometimes our program is not on the same machine as the database, when we need to access the database remotely. By default,
In the previous article to introduce the MyEclipse connection MySQL database method, through this article to introduce how to access the MySQL database in the Java program data and simple operation, details please see below.
Create a Javaproject
If you insert two rows of ' a ' and ' a ' on a column with unique constraints on MySQL, MySQL will think it's the same, but not in Oracle. It's MySQL. Default field values are not case-sensitive? This is a more troubling thing. Use the client
MySQL is a relational database management system, and MySQL is one of the best RDBMS (relational database Management system, relational DBMS) application software in WEB applications. With PHP and Apache to form a good development environment.
Several common MySQL functions, MySQL to judge Chinese characters, dates, numbers of specific functions to share with you, the specific contents are as follows
1. Judge whether the string is a Chinese character return value: 1-Chinese characters
For example, let's take a look at the difference between a clustered index and a nonclustered index:
In fact, the text of our Chinese dictionary is itself a clustered index. For example, if we look at the word "Ann", we will naturally open the first
First MySQL official website from http://dev.mysql.com/downloads/download MySQL server installation package, I download for version "
Mysql-installer-community-5.7.3.0-m13.msi "Not much to say, double-click to enter the installation."
The
CHAR
Char (M) m character, length is m* character encoding length, M Max 255.
The verification is as follows:
mysql> CREATE table T1 (name char (256)) default Charset=utf8;
ERROR 1074 (42000): column length too big for Column ' name ' (max
Basic operations
View Database
show databases;
Specify character Set
create database day15
default character set UTF8
View Character Set
show CREATE database day15;
Delete
drop Database Day15
A. mysql command line mode settings
Desktop-> My Computer-> properties-> environment variable-> new->Path= "; path\mysql\bin;" Where path is the installation path for MySQL.
Second, the command line to enter the MySQL method
1.c:\>mysql-h
This example describes the MySQL subquery usage. Share to everyone for your reference, specific as follows:
Suppose the table my_tbl contains three field a,b,c; now you need to query the number of records for which column B is the minimum for each
In MySQL, how do you use SQL statements to rename a field in a table? We will use ALTER TABLE, an SQL statement.
The syntax for renaming a field is: ALTER TABLE change .
Now let's try to rename the T_name field in the test table to 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