To modify the database character set:
ALTER DATABASE db_name DEFAULT CHARACTER SET character_name [COLLATE ...];
Change the default character set of the table and all character columns (Char,varchar,text) to the new
show databases //List MySQL Server database. show tables [from db_name] //lists the database data tables. show table status [from db_name] //lists data tables and table status
1. Delete the database name of the drop databases database;mysql> drop database test;That is, delete the database schema2 . Create DATABASE Database namemysql> CREATE DATABASE test;Windows and Linux handle database names and table names
First create a MySQL database storage directory, it is recommended to create an LVM volume to hold the database filesMkdir/mysqldata/dataAdd MySQL UserGroupadd-r MySQLUseradd-g mysql-r-s/sbin/nologin-m-d/mysqldata/data MySQLModify the owner and host
#!/bin/bash #This is a ShellScript. For Auto DB Backup #Powered by [email protected] #2014/2/25#setting #设置数据库名, database login, password, backup path, log path, data file location, and backup method # By default, the backup method is tar, or
As we all know, increasing the index is improvingEnquiryStill do not use the index, this situation seriously affects performance, here is a brief summary of a fewififThe column key is evenly distributed between 1 and 100, and the
Check to see if the system has the MySQL-to-use command:Rpm-qa | grep MySQLTo uninstall an installed mysql--> use command:#rpm-E--nodeps mysql-libs-*Delete all files under the/var/lib/mysql folder MySQL Installation:Execute command: Install
1. Summary of the use of MySQL client tools
About executing SQL scripts
In the MySQL client, you can Source/xxx/yyy/zzz.sqlIf the shell command line can be executed mysql-uxxx-pyyy-hzzz
Description of the MySQL stored procedure: http://www.cnblogs.com/exmyth/p/3303470.html Get, modify, and delete data (same as normal SQL statements): When fetching data, use an into to assign the ID to the newId defined in the stored procedure.
If you forget the root password or other user password, do not worry, just follow the steps below. 1. Edit the MySQL master profile my.cnfvim/etc/my.cnfAdd a parameter under the [mysqld] field skip-grant2. Restart the database serviceService mysqld
MySQL Master master sync (AB replication)Mutual primary MySQL server, mutual for from MySQL server Master1 master2192.168.4.1 192.168.4.2 One, public configuration: Server MySQL startping 192.168.4.1ping 192.168.4.2 off iptables selinux off
Mysql database version control dbv usage
Version Control software includes svn git and so on. These tools control the source code version very well, but what about database version control? The traditional method is to export the entire database, so
In SUSE Linux, the source code compilation method is used to install MySQL 5.6.
MySQL is an open-source database, so it can be installed based on the source code. Source code-based installation provides more flexibility. That is to say, we can
Retrieve the deleted data table from mysql
D: \ wamp \ bin \ mysql \ mysql5.6.17 \ bin> mysqlbinlog.exe d:/mysql/data/mysql-bin.000068> d: \ d68.sqlD: \ wamp \ bin \ mysql \ mysql5.6.17 \ bin> mysqlbinlog.exe d:/mysql/data/mysql-bin.000069> d: \ d69
Implicit conversions in MySQL1. Environment Description
Blog: http://blog.csdn.net/hw_libo/article/details/39252427
RHEL 6.4 x86_64 + MySQL 5.6.19
Test Table:
MySQL [test]> show create table emp\G*************************** 1. row *******************
Insert multiple data records using one mysql statement and multiple data records using one mysql statement
Assume that there is A data table:
Id name title addtime
To insert n data entries:
$time= time();$data = array( array(
MySQL cold backup solution for important businesses and mysql cold backup solution1. Overview
In the company's business, when the corresponding business data is not very important, we generally write a script to pull the full database data every
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