MySQL notes (1)

1.show databases; Show all databases2.create database name [other options]; New DatabaseExample: Create database example_db character Set GBK; A database named example_db is created and the database character encoding is specified as GBK for easy

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

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,

MySQL database installation and use

The downloaded MySQL has two versions: one is. msi, can be installed directly, and then start the service in Services.msc;The other is to be configured with the following steps:1. Place the files where you want them, similar to the program

C # reads all field names for a MySQL table

1. Read all the fields of a table using C # SQL statements2. Execute the following SQLString strSQL = String. Format ("Select column_name from Information_schema.columns where table_name= '" + the table name that needs to be queried + "' and

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 Query exercise

mysql> #查询每个栏目最贵的商品mysql > select goods_id,shop_price,cat_id from (select goods_id,shop_price,cat_id from goods ORDER BY shop_price DESC) as temp GROUP by cat_id;+----------+------------+--------+| goods_id | Shop_price | cat_id |+----------+--

The difference between Mycat and MySQL--mycat the core role

A friend was asked at the interview: the difference between Mycat and MySQL. We can think of the upper layer as an abstraction of the underlying, such as an abstraction of various kinds of computer hardware by the operating system. So when do we

Remote connection to Linux server MySQL

I'm having a problem today. Unable to remotely link MySQLHost ' XXX ' is not allowed to connect to this MySQL server solution/How to turn on MYSQSolve the first prompt question firstIt turns out that no Telnet user was created in MySQLLog in to

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

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

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

The role of M in MySQL Int (m)

Int (m) This m represents the width of the displayFunction: In the front-end to display an integer type of data, the database set the corresponding data type int (4), but the data written less than 4 bits, then the left padding space (if Zerofill is

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

MySQL can be used to change the root password.

MySQL can be used to change the root password.Zookeeper Method 1: use the set password command Mysql-u root Mysql> set password for 'root' @ 'localhost' = PASSWORD ('newpass '); Method 2: Use mysqladmin Mysqladmin-u root password "newpass"

Total Pages: 3233 1 .... 2876 2877 2878 2879 2880 .... 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.