Mysql adds and deletes users and assigns Permissions

1. Add a user Copy codeThe Code is as follows:Mysql> insert into mysql. user (Host, User, Password) values ("localhost", "lionbule", password ("hello1234 "));Mysql> flush privileges; 2. Change the User Password Copy codeThe Code is as follows:Mysql>

How to install two MYSQL Databases on one machine in windows

Environment:OS: Windows 2003DB: MYSQL5.51. Install the first mysql normally (the installation steps are omitted)2. Stop the first mysql service in the control panel3. copy all the directories and Files under the C: \ Program Files \ MySQL directory

Multiple methods for setting remote database access for mysql

It may be that the IP address is not set. Problem: the MySQL permission is set correctly, but remote access is still unavailable. Port 3306 is not opened through telnet. Analysis: by default, MySQL only binds 127.0.0.1, that is, port 3306 can be

Error summary during mysql-5.5.28 source code Installation

Introduction About mysql-5.5.28 source code installation process in a few major errors summary, I hope this article to help you.CentOS 6.3 mini (no compiling environment)The pre-compiled environment first installs the well-known cmake (yum install

Example of where id in (, 3 ,...)

Normal Syntax:Copy codeThe Code is as follows:Select * from table_name t where t. field1 in (1, 2, 3, 4 ,...); When the list in the write stored procedure in is substituted with an input parameter, the following method is required:The find_in_set

How mysql optimizes the slow retrieval of random data

The day before yesterday, I needed to randomly extract several records from a database with 5 million records because of my work. Here I directly use the mysql rand by function. It doesn't matter if there are thousands of records, however, if tens

Mysql String Length function (CHAR_LENGTH)

Length: the length of a calculated field. A Chinese character is counted as three characters. A number or letter is counted as one character.The return value of CHAR_LENGTH (str) is the length of the str string, measured in characters. A multi-byte

Script code for automatically backing up MySQL Databases in Linux

In the script, you can set the list of database tables to be backed up and compress the backup files through gzip. Note that this script is only applicable to environments with low data consistency requirements.Copy codeThe Code is as follows:#!

How to obtain random data from mysql

1. order by rand ()The data is too slow and the randomness is very good. It is suitable for situations with very small data volumes.Copy codeThe Code is as follows:SELECT * FROM table_name AS r1 JOIN (SELECT (ROUND (RAND () * (select abs (MAX

How to modify the start value of mysql auto-increment ID

Many friends in mysql think that the field AUTO_INCREMENT Type Auto-increment ID value cannot be modified. In fact, this is an incorrect understanding. The following describes how to modify and set the starting value of mysql auto-increment ID.The

Timed MySQL timeout using Linux Shell scripts

Recently, I just entered a new company and took over a site here. The architecture design of this site is not reasonable, so MySQL is always under great pressure, the Locked process often times out, so a Linux Shell script is compiled to kill these

Analysis of the problem that MySQL directly returns NULL without GROUP BY HAVING

There is a table whose id is the primary key. In this way, a record can be returned:Copy codeThe Code is as follows:"SELECT * FROM t HAVING id = MIN (id );"However, if you replace MIN with MAX, the returned result is null:Copy codeThe Code is as

How to import and export databases and data tables from mysql

LinuxAll operations in the console.Import database:Prerequisites: the database and data table must exist (already created) (1) import the data table test_user. SQL TO THE test_user table of the test database.[Root @ test ~] # Mysql-uroot-p test (2

Debian6 how to configure mysql to allow remote connection (figure)

Debian6 system: First install mysql: Open the terminal (root) User Login Apt-get purge mysql-server-5.5 After installation: By default, Mysql only allows local login, so you need to modify the configuration file to bind the address to comment

MySQL timer EVENT Learning notes

The constant GLOBAL event_scheduler of MySQL must be on or 1.-- Check whether the timer is enabledShow variables like '% sche % ';-- Enable the timer 0: off 1: onSet global event_scheduler = 1;-- Create an event-- Automatically calls the e_test ()

Mysql format decimal places retain the last two decimal places (decimal point format)

Copy codeThe Code is as follows:Select format (12562.6655, 2 ); Result: 12,562.67 See the document Formats the number X to a format like '#,###,###. # ', rounded to D decimal places, and returns the result as a string. if D is 0, the result has no

How does mysql merge multi-row query results into one row?

When a single ID corresponds to multiple names using the function group_concat (), the name is merged into one row for multiple rows of data.Complete Syntax:GROUP_CONCAT (expr)This function returns a string with a non-NULL value from a group of

What is the use of transactions in Mysql?

What is a transaction? A transaction is a logical group of operations that constitute each unit of this group of operations. If it fails or fails, it is a transaction.Note: mysql DATA supports transactions, but must be an innoDB Storage engine.Solve

How to enable bin-log mysql to report errors

When creating a stored procedure Error message:Copy codeThe Code is as follows:ERROR 1418 (HY000): This function has none of DETERMINISTIC, no SQL, or reads SQL DATA in its declaration and binary logging is enabled (you * might * want to use the

Mysql Dynamic Cursor Learning (mysql Stored Procedure cursor)

Copy codeThe Code is as follows:-- Create test tables and dataCreate table webuser (username varchar (10 ));Insert into webuser values ('a1'), ('a2 '), ('a3'), ('b1'), ('b2'), ('b3 ');Commit;-- Create a stored procedureDrop procedure if exists

Total Pages: 3233 1 .... 2745 2746 2747 2748 2749 .... 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.