The operation is in the Ubuntu system under the environment, a simple record of the process.
First use Apt-get to install the database, type the command sudo apt-get install mysql-server, all the way to enter, and then set the database root
First create a table
Use Test;
Create Table Tabletest (
' ID ' Mediumint (8) Default ' 0 ',
' Name ' varchar default '
) Type=myisam;
Import data to a datasheet
Load Data InFile ' c:/data.txt ' into Table ' tabletest '
Commonly used as
First, add the user rights that can be logged on the primary server:
GRANT REPLICATE SLAVE on *.* to ' username ' @ ' host ' identified by ' password '
Then set the primary server's My.ini file.
Server-id=1 #主服务器标识
Log-bin
When a server connects to the primary server, it notifies the primary server of the location of the last successful update that was read from the server in the log. Receive any updates from the server that have occurred since then, and then block
Believe that a lot of personal site webmaster, or independent blog blogger, have a backup database such a demand. Of course WordPress such plug-ins very rich blog system has a lot to help you complete the task of plug-ins. If you need to personally
The basic principle is to have the primary database handle transactional queries and select queries from the database. Database replication is used to synchronize changes caused by transactional queries to the database from the cluster.
The
For example, if a client executes a query but is interested only in line 1th, the remaining rows are not transferred.
The cursor is read-only and the row cannot be updated with the cursor.
Update where current and delete where current is not
Take Mysql-noinstall-5.0.22-win32 as an example, after decompression will see the Mysql-5.0.22-win32 folder below, there are five INI format files, the My-medium.ini file copies a copy, renamed My.ini, open My.ini file, in Under [client], [mysqld]
The database file is large, about 70G,
If you have a normal migration, you need to export the data in the original database and then import the data in the new database
After careful consideration, is MySQL's database file stored in the same format
######## This configuration is available in httpd.conf or other. conf files
######## APACHE2 supports a variety of authentication/authentication methods, this article only involves MYSQL authentication/authentication Mode
#/svn is the address of the
Daily backup MySQL database tasks, delete the specified number of days before the data, keep the date of the specified day;
Demand:1, backup MySQL data 4 points per day;2, to save space, delete more than 3 months of all backup data;3, delete more
Setting up the database
The text or integer type of fields that we usually use in the database and the fields that need to save the picture are different in the amount of data they need to keep. The MySQL database uses specialized fields to hold
Responsibilities of the database administrator
Server Startup and shutdown
User Account Maintenance
Log file Maintenance
Backup and copy of database
Server optimization
Software update of database management system
Security of Data
Usually, we will use the order by LIMIT start, offset to do the paging query. For example, the following SQL:
SELECT * from ' T1 ' WHERE ftype=1 the ORDER by ID DESC LIMIT 100, 10;
Or, like the following paged SQL without any conditions:
MySQL often appears in the Chinese support unfriendly situation common error "illegal mix of collations for operation"
Let's do a regular set of what character sets are involved in the MySQL database
Character-set-server/default-character-set:
The MySQL database has been used for a long time because of work needs. Basically have forgotten almost. Today reinstall configuration for a while, write an essay record, lest oneself later when need to look over, if there is incorrect or need to
The MYSQL server installation steps are as follows:
1 Installing MySQL Server
2 Installing MySQLServer management tools
Extract the Chinese Language pack and copy the files to the
Storage Engine: 1. View Supported storage engines: show Engines \g;Show variables like ' have% '; 2. View the default storage engine: Show variables like ' storage_engine% '; 3. Modify the default storage engine: ① installation can be done by using
The migration plan is as follows:
1. Back up MySQL 5.5 database and make a backup of the specified library.
2. Restore to MARIADB, and then establish replication.
3. Then you can be willing to switch when and when.
The problems encountered:
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