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>
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
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
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
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
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
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
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:#!
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
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
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
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
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 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
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 ()
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
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 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
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
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
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.