MySQL creates a database of the specified character set

Take the example of creating a database with a character set of UTF8:CREATE DATABASE db_name DEFAULT CHARACTER SETUTF8 COLLATE utf8_general_ci;CREATE DATABASEThe syntax:CREATE{DATABASE | SCHEMA}[IF not EXISTS] db_name[create_specification [,

MySQL Common statements

Create a database CREATE DATABASE IF not EXISTS $database DEFAULT CHARSET UTF8 COLLATE utf8_general_ci; CREATE DATABASE $database DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci; Create a user and add permissions # just create

MySQL BULK Insert random data Method--stored procedure

Create a test table: MySQL> Create TableBigdata (IDint, nameChar(2) ; Create stored procedure: MySQL>Delimiter//MySQL> Create procedureRand_data (inchNumint) - begin - Declare Str Char( +)default 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0

MySQL Query big table an error occurred

The following error occurred during the first Test execution: Bigdata There are 1 million data MySQL> Select Count(*) from(Select distinct(ID) fromBigdata) asTotal ; ERROR1317(70100): Query execution was interrupted waited a while and then executed

View IP information connected to MySQL database

To count the number of connections to a database, we typically count the totals without subdividing each IP. Now to monitor the number of connections per IP, the implementation is as follows:Method One:Select Substring_index (Host, ': ', 1) as IP,

Regular backup of MySQL database on Linux

Scheduled BACKUP Database/usr/sbin/backupmysqltimestamp= ' date + '%y-%m-%d-%h-%m-%s 'Mysqldump-uroot-p ' 123456 databasename>/db$timestamp.sqlchmod +x BackupmysqlInstall Crontab:[email protected] ~]# Yum install Vixie-cron[email protected] ~]# Yum

MySQL import Chinese data garbled four ways to solve

Method One: Solve garbled problem by adding parameter--default-character-set = UTF8Method One: Solve garbled problem by adding parameter--default-character-set = UTF8Mysql-u root-p Password Method Two: Import garbled address in command lineUse

Delete duplicate records (MySQL) under a specific impact factor (field column)

;CREATE TABLEtabtest (' id 'INT( One) not NULLauto_increment, ' Factora 'VARCHAR(255) not NULL DEFAULT ' ', ' Factorb 'VARCHAR(255) not NULL DEFAULT ' ', ' Factorc 'DECIMAL(Ten,2) not NULL DEFAULT 0, ' remark 'VARCHAR(255) not NULL DEFAULT ' ' ,

Modify the MySQL Data directory

Environment: CentOS Linux release 7.1.1503 (Core)1. Install MySQLwget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpmRPM-IVH mysql-community-release-el7-5yuminstall mysql-community-Serverserivce Mysqld StartNow look at the data

MySQL remote login not on

When you connect to MySQL using TCP/IP, it appears:Can ' t connect to MySQL server on ' xxx.xxx.xxx.xxx. ' (111)This error.After repeated toss:Determine IP Yes, user rights are available (support remote IP connection), config file to unregister IP

MySQL Learning notes--operations on the database

First, start/Shut down the database service:1. Open cmd Command Prompt window2, enter the command net start MySQL , enter, then started the MySQL service3. After entering the command net stop MySQL , enter, then turn off the MySQL serviceSecond, the

MySQL Learning (2) Creating and deleting databases

Create a database{} Required | Select from front and back [] optionalCreate {database | schema} [if not EXISTS] db_name [default] Character Set [=] Charset_nameCreate a database T1Create DATABASE T1;View all databasesShow database;If not exists (if

Left join in MySQL, right join

Left (outer) Join: The table is the main, which contains all the rows of the left table, and the right table satisfies the recorded data listRight (outer) join: The table that is the main, contains all the rows of the right table, and the left table

MySQL Common commands

One, connect MySQLlocalhost: mysql-h host address-u user name-P user PasswordRemote host: mysql-h host ip-u user name-p user PasswordSecond, change the passwordMysqladmin-u username-p Old password password new passwordThird, create the

MySQL to_days ()

MySQL to_days (date) function to_days (date)Given a date , returns a number of days, starting from year 0.Mysql> SELECT to_days (950501);728779Mysql> SELECT to_days (' 1997-10-07′);729669To_days () is not used for values before the Gregorian

Ubuntu 1204 Install MySQL

Detects if the machine has MySQL installed| grep mysqlAfter executing the above command, you see that the MYSQ socket is in the listening state, indicating that the installation was successful.Install MySQLsudo apt-get install mysql-server

MySQL Sub-table

Sub-table strategy1, according to the characteristics of the time table, different days, the time may be uneven, some more, some less, and may appear too large data volume situation2, according to the hash Modulus sub-table (or primary key to mold)

Mysql slave State of Seconds_behind_master

In MySQL's master-slave environment, we can view some of slave's state information by executing the show slave status on Slave, which has a more important parameter seconds_behind_master. So do you understand what it really means and how it's

MySQL Partitioning technology

There are two main types of optimizations for massive data:the way of large table splitting table; optimization of SQL statements Partitioning Technology:similar to horizontal segmentation, but it is a horizontal table at the logical level, which is

Install Mysql and redhatrpm in rpm mode in RedHat 5.8

Install Mysql and redhatrpm in rpm mode in RedHat 5.8 I want to install Mysql 5.6 ..1. Prepare the file:1) Mysql-client-5.6.24-1.rhel5.x86_64.rpm2) Mysql-server-5.6.24-1.rhel5.x86_64.rpm2. Remove the Mysql version from the system: yum remove mysql*;

Total Pages: 3233 1 .... 2601 2602 2603 2604 2605 .... 3233 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.